Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 63e97ad

Browse files
committed
Jack Jansen, Mac patch:
Include stat.h if needed; different Mac filename compare
1 parent 4cc6ac7 commit 63e97ad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Python/import.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
3939
#endif
4040
#ifndef DONT_HAVE_SYS_STAT_H
4141
#include <sys/stat.h>
42+
#elif defined(HAVE_STAT_H)
43+
#include <stat.h>
4244
#endif
4345

4446
#if defined(PYCC_VACPP)
@@ -1129,8 +1131,7 @@ check_case(char *buf, int len, int namelen, char *name)
11291131
name, buf);
11301132
return 0;
11311133
}
1132-
p2cstr(fss.name);
1133-
if ( strncmp(name, (char *)fss.name, namelen) != 0 ) {
1134+
if ( namelen > fss.name[0] || strncmp(name, (char *)fss.name+1, namelen) != 0 ) {
11341135
PyErr_Format(PyExc_NameError,
11351136
"Case mismatch for module name %.100s\n(filename %.300s)",
11361137
name, fss.name);

0 commit comments

Comments
 (0)