aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-02-27 12:45:19 +0000
committerRon Yorston <rmy@pobox.com>2018-02-27 12:45:19 +0000
commitdecda04ffdbe4803e3d346b3784403b68faba82e (patch)
tree015785f6173dd4aaeffc4adcb7bc6dd65ff4a6b0 /win32
parent36c480447a025f965af871cac6722ffc2b550f05 (diff)
downloadbusybox-w32-decda04ffdbe4803e3d346b3784403b68faba82e.tar.gz
busybox-w32-decda04ffdbe4803e3d346b3784403b68faba82e.tar.bz2
busybox-w32-decda04ffdbe4803e3d346b3784403b68faba82e.zip
win32: fix code to check for file extensions
The has_win_suffix function didn't check that the extension started with a '.'. As a result the shell was unable to execute cmd.exe.
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 713778ff1..22e62232d 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1013,7 +1013,7 @@ static int has_win_suffix(const char *name, int start)
1013{ 1013{
1014 int i, len = strlen(name); 1014 int i, len = strlen(name);
1015 1015
1016 if (len > 4) { 1016 if (len > 4 && name[len-4] == '.') {
1017 for (i=start; i<4; ++i) { 1017 for (i=start; i<4; ++i) {
1018 if (!strcasecmp(name+len-3, win_suffix[i])) { 1018 if (!strcasecmp(name+len-3, win_suffix[i])) {
1019 return 1; 1019 return 1;