Skip to content

Commit 04db96a

Browse files
committed
mingw: do not special-case .exe files anymore
Since baaf233 (connect: improve check for plink to reduce false positives, 2015-04-26), t5601 writes out a `plink.exe` for testing that is actually a shell script. So the assumption that the `.exe` extension implies that the file is *not* a shell script is now wrong. The original idea to special-case `.exe` files was probably to help performance, but since we are in a code path that involves spawning a new process (which in and of itself is pretty slow on Windows anyway), we pursue a better idea to improve performance elsewhere: we try to convert scripts into builtins and to reduce the number of spawned processes by adding more internal API calls. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2a41dee commit 04db96a

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

compat/mingw.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -971,11 +971,6 @@ static const char *parse_interpreter(const char *cmd)
971971
char *p, *opt;
972972
int n, fd;
973973

974-
/* don't even try a .exe */
975-
n = strlen(cmd);
976-
if (n >= 4 && !strcasecmp(cmd+n-4, ".exe"))
977-
return NULL;
978-
979974
fd = open(cmd, O_RDONLY);
980975
if (fd < 0)
981976
return NULL;

0 commit comments

Comments
 (0)