[Python-checkins] CVS: python/dist/src/Python import.c,2.154,2.155

Guido van Rossum python-dev@python.org
Wed, 10 Jan 2001 12:40:48 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv31527/Python

Modified Files:
	import.c 
Log Message:
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 _).



Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.154
retrieving revision 2.155
diff -C2 -r2.154 -r2.155
*** import.c	2000/11/13 17:26:32	2.154
--- import.c	2001/01/10 20:40:46	2.155
***************
*** 1011,1015 ****
  #ifdef CHECK_IMPORT_CASE
  
! #ifdef MS_WIN32
  #include <windows.h>
  #include <ctype.h>
--- 1011,1015 ----
  #ifdef CHECK_IMPORT_CASE
  
! #if defined(MS_WIN32) || defined(__CYGWIN__)
  #include <windows.h>
  #include <ctype.h>
***************
*** 1040,1043 ****
--- 1040,1047 ----
  }
  
+ #ifdef __CYGWIN__
+ #include <sys/cygwin.h>
+ #endif
+ 
  static int
  check_case(char *buf, int len, int namelen, char *name)
***************
*** 1045,1051 ****
--- 1049,1063 ----
  	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,