From 4c3f57cf05c9d7ea5b1ff681703b95ce034f16c3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 10 Jan 2001 20:40:46 +0000 Subject: 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 _). --- Python/import.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/import.c b/Python/import.c index e3a70c71a9..a97d0c66ec 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 #include @@ -1039,14 +1039,26 @@ allcaps8x3(char *s) return 1; } +#ifdef __CYGWIN__ +#include +#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)", -- cgit v1.2.1