git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
d9061ed
)
mingw: detect when MSYS2's sh is to be spawned more robustly
author
Johannes Schindelin
<redacted>
Thu, 19 Sep 2019 15:05:21 +0000
(17:05 +0200)
committer
Johannes Schindelin
<redacted>
Fri, 6 Dec 2019 15:31:14 +0000
(16:31 +0100)
Signed-off-by: Johannes Schindelin <redacted>
compat/mingw.c
patch
|
blob
|
history
diff --git
a/compat/mingw.c
b/compat/mingw.c
index 0e14cab0126559217b07a049ba11d22621c83877..5dbaae981e40fa3ef91f54a29ce9a42aaedf68c9 100644
(file)
--- a/
compat/mingw.c
+++ b/
compat/mingw.c
@@
-1391,7
+1391,10
@@
static inline int match_last_path_component(const char *path, size_t *len,
static int is_msys2_sh(const char *cmd)
{
- if (cmd && !strcmp(cmd, "sh")) {
+ if (!cmd)
+ return 0;
+
+ if (!strcmp(cmd, "sh")) {
static int ret = -1;
char *p;
@@
-1411,6
+1414,16
@@
static int is_msys2_sh(const char *cmd)
}
return ret;
}
+
+ if (ends_with(cmd, "\\sh.exe")) {
+ static char *sh;
+
+ if (!sh)
+ sh = path_lookup("sh", 0);
+
+ return !fspathcmp(cmd, sh);
+ }
+
return 0;
}
git clone https://git.99rst.org/PROJECT