From 89f293080132e4fb02806d53a8bb5c7d465bc709 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 10 Jun 2015 15:52:22 +0000 Subject: [PATCH] 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 --- compat/mingw.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 24ef6ee0aa..900afce781 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -836,11 +836,6 @@ static const char *parse_interpreter(const char *cmd) char *p, *opt; int n, fd; - /* don't even try a .exe */ - n = strlen(cmd); - if (n >= 4 && !strcasecmp(cmd+n-4, ".exe")) - return NULL; - fd = open(cmd, O_RDONLY); if (fd < 0) return NULL;