Add python2 package
This commit is contained in:
32
python2/2.7.5-getpath-exe-extension.patch
Normal file
32
python2/2.7.5-getpath-exe-extension.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
diff -urN a/Modules/getpath.c b/Modules/getpath.c
|
||||
--- a/Modules/getpath.c 2013-10-20 19:34:40.007865900 +0100
|
||||
+++ b/Modules/getpath.c 2013-10-20 19:35:08.184477500 +0100
|
||||
@@ -451,6 +451,28 @@
|
||||
if (isxfile(progpath))
|
||||
break;
|
||||
|
||||
+#ifdef __CYGWIN__
|
||||
+ /*
|
||||
+ * Cygwin automatically removes the ".exe" extension from argv[0]
|
||||
+ * to make programs feel like they are in a more Unix-like
|
||||
+ * environment. Unfortunately, this can make it problemmatic for
|
||||
+ * Cygwin to distinguish between a directory and an executable with
|
||||
+ * the same name excluding the ".exe" extension. For example, the
|
||||
+ * Cygwin Python build directory has a "Python" directory and a
|
||||
+ * "python.exe" executable. This causes isxfile() to erroneously
|
||||
+ * return false. If isdir() returns true and there is enough space
|
||||
+ * to append the ".exe" extension, then we try again with the
|
||||
+ * extension appended.
|
||||
+ */
|
||||
+#define EXE ".exe"
|
||||
+ if (isdir(progpath) && strlen(progpath) + strlen(EXE) <= MAXPATHLEN)
|
||||
+ {
|
||||
+ strcat(progpath, EXE);
|
||||
+ if (isxfile(progpath))
|
||||
+ break;
|
||||
+ }
|
||||
+#endif /* __CYGWIN__ */
|
||||
+
|
||||
if (!delim) {
|
||||
progpath[0] = '\0';
|
||||
break;
|
||||
Reference in New Issue
Block a user