[Patches] Revised patch for import.c

Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Wed, 28 Jun 2000 07:17:40 +0200 (CEST)


Jack Jansen wrote:
> 
> Here's a new version of my previous patch to import.c, using #elif in stead of
> nested #ifdefs.
> 
> Use a different way to compare pyc filenames, on the mac only, making it easier
> to port to macosx.

Jack, the HAVE_STAT_H symbol does not have an entry in the usual config.h
file, so my guess is that you have a Mac-specific version of it that you are
maintaining and that I can't eyeball. Is this correct?

If yes, I don't see anything wrong with this patch because there's no
way it can interfere with other systems. So, +1 from me. If you don't
move it to SourceForge quickly and nobody applies it in the meantime,
I'll move it to SF for you.

> 
> Index: import.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
> retrieving revision 2.134
> diff -c -r2.134 import.c
> *** import.c	2000/05/03 23:44:39	2.134
> --- import.c	2000/06/08 21:50:24
> ***************
> *** 60,65 ****
> --- 60,67 ----
>   #endif
>   #ifndef DONT_HAVE_SYS_STAT_H
>   #include <sys/stat.h>
> + #elif defined(HAVE_STAT_H)
> + #include <stat.h>
>   #endif
>   
>   #if defined(PYCC_VACPP)
> ***************
> *** 1132,1139 ****
>   		     name, buf);
>   		return 0;
>   	}
> ! 	p2cstr(fss.name);
> ! 	if ( strncmp(name, (char *)fss.name, namelen) != 0 ) {
>   		PyErr_Format(PyExc_NameError,
>   		     "Case mismatch for module name %.100s\n(filename %.300s)",
>   		     name, fss.name);
> --- 1134,1140 ----
>   		     name, buf);
>   		return 0;
>   	}
> ! 	if ( namelen > fss.name[0] || strncmp(name, (char *)fss.name+1, namelen) !=
> 0 ) {
>   		PyErr_Format(PyExc_NameError,
>   		     "Case mismatch for module name %.100s\n(filename %.300s)",
>   		     name, fss.name);
> 
> _______________________________________________
> Patches mailing list
> Patches@python.org
> http://www.python.org/mailman/listinfo/patches
> 


-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252