3 * from cygport
2.7.3-getpath
-exe
-extension
.patch
5 --- Modules
/getpath
.c
.orig
2013-04-06 14:02:37.000000000 +0000
7 @@
-436,6 +436,28 @@
calculate_path(void)
13 + * Cygwin automatically removes the ".exe" extension from argv[0]
14 + * to make programs feel like they are in a more Unix-like
15 + * environment. Unfortunately, this can make it problemmatic for
16 + * Cygwin to distinguish between a directory and an executable with
17 + * the same name excluding the ".exe" extension. For example, the
18 + * Cygwin Python build directory has a "Python" directory and a
19 + * "python.exe" executable. This causes isxfile() to erroneously
20 + * return false. If isdir() returns true and there is enough space
21 + * to append the ".exe" extension, then we try again with the
22 + * extension appended.
25 + if (isdir(progpath
) && strlen(progpath
) + strlen(EXE
) <= MAXPATHLEN
)
27 + strcat(progpath
, EXE
);
28 + if (isxfile(progpath
))
31 +#endif /* __CYGWIN__ */