[Patches] Revised patch for import.c

Jack Jansen Jack.Jansen@oratrix.com
Thu, 08 Jun 2000 23:53:23 +0200


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.

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);