]> granicus.if.org Git - python/commitdiff
Jack Jansen, Mac patch:
authorGuido van Rossum <guido@python.org>
Sat, 1 Jul 2000 01:06:56 +0000 (01:06 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 1 Jul 2000 01:06:56 +0000 (01:06 +0000)
Include stat.h if needed; different Mac filename compare

Python/import.c

index a34d6c36d2ebe28fee646f531d634706a0761117..7e74f2bb758adbbc471f37e4bb1231d62e8df27e 100644 (file)
@@ -39,6 +39,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 #endif
 #ifndef DONT_HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#elif defined(HAVE_STAT_H)
+#include <stat.h>
 #endif
 
 #if defined(PYCC_VACPP)
@@ -1129,8 +1131,7 @@ check_case(char *buf, int len, int namelen, char *name)
                     name, buf);
                return 0;
        }
-       p2cstr(fss.name);
-       if ( strncmp(name, (char *)fss.name, namelen) != 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);