summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-01-10 20:40:46 (GMT)
committerGuido van Rossum <guido@python.org>2001-01-10 20:40:46 (GMT)
commit4c3f57cf05c9d7ea5b1ff681703b95ce034f16c3 (patch)
tree1f6977ba86b4e8ca7dff69e3161bdb386a486bec /Python
parentf61f166bca4f17c1199c12184ebc41755c0fb8e0 (diff)
downloadcpython-4c3f57cf05c9d7ea5b1ff681703b95ce034f16c3.zip
cpython-4c3f57cf05c9d7ea5b1ff681703b95ce034f16c3.tar.gz
cpython-4c3f57cf05c9d7ea5b1ff681703b95ce034f16c3.tar.bz2
SF Patch #103154 by jlt63: Cygwin Check Import Case Patch.
Note: I've reordered acconfig.h and config.h.in to obtain alphabetical order (modulo case and leading _).
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index e3a70c7..a97d0c6 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1010,7 +1010,7 @@ find_module(char *realname, PyObject *path, char *buf, size_t buflen,
#ifdef CHECK_IMPORT_CASE
-#ifdef MS_WIN32
+#if defined(MS_WIN32) || defined(__CYGWIN__)
#include <windows.h>
#include <ctype.h>
@@ -1039,14 +1039,26 @@ allcaps8x3(char *s)
return 1;
}
+#ifdef __CYGWIN__
+#include <sys/cygwin.h>
+#endif
+
static int
check_case(char *buf, int len, int namelen, char *name)
{
WIN32_FIND_DATA data;
HANDLE h;
+#ifdef __CYGWIN__
+ char tempbuf[MAX_PATH];
+#endif
if (getenv("PYTHONCASEOK") != NULL)
return 1;
+#ifdef __CYGWIN__
+ cygwin32_conv_to_win32_path(buf, tempbuf);
+ h = FindFirstFile(tempbuf, &data);
+#else
h = FindFirstFile(buf, &data);
+#endif
if (h == INVALID_HANDLE_VALUE) {
PyErr_Format(PyExc_NameError,
"Can't find file for module %.100s\n(filename %.300s)",