aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch b/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch
new file mode 100644
index 000000000000..68f6921ba6aa
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/interpreters/python/cpython/2.7/2.7.3-getpath-exe-extension.patch
@@ -0,0 +1,31 @@
+--- origsrc/Modules/getpath.c.orig 2012-11-27 12:07:56.098645900 -0500
++++ src/Modules/getpath.c 2012-11-27 12:10:11.254895900 -0500
+@@ -436,6 +436,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;