--- ../python-dev/Modules/getpath.c 2006-07-28 18:38:22.235324800 +0300 +++ Modules/getpath.c 2006-08-21 10:57:16.453125000 +0300 @@ -362,6 +362,26 @@ return 0; } +#ifdef __CYGWIN__ + +void +add_exe_suffix(char *progpath) +{ + char *suffix_start; + char EXE_SUFFIX[] = ".exe"; + + suffix_start = progpath + strlen(progpath) - strlen(EXE_SUFFIX); + + /* Already have an .exe suffix */ + if (strncmpi(EXE_SUFFIX, suffix_start, strlen(EXE_SUFFIX)) == 0) { + return; + } + + strcat(progpath, EXE_SUFFIX); +} + +#endif /* __CYGWIN__ */ + static void calculate_path(void) @@ -443,6 +463,11 @@ progpath[0] = '\0'; if (progpath[0] != SEP) absolutize(progpath); + +#ifdef __CYGWIN__ + add_exe_suffix(progpath); +#endif + strncpy(argv0_path, progpath, MAXPATHLEN); argv0_path[MAXPATHLEN] = '\0';