aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-12-07 15:49:54 +0000
committerRon Yorston <rmy@pobox.com>2018-12-07 16:01:11 +0000
commit1e68bd2ca699f3388ae149f986b61aa6d105550c (patch)
tree701a540005d0c1ae98b25880cd5bfe11fa9fa558
parentc4cc5784faad0655d2fe9e462105f2ea142d3363 (diff)
downloadbusybox-w32-1e68bd2ca699f3388ae149f986b61aa6d105550c.tar.gz
busybox-w32-1e68bd2ca699f3388ae149f986b61aa6d105550c.tar.bz2
busybox-w32-1e68bd2ca699f3388ae149f986b61aa6d105550c.zip
win32: (another) fix to file extension test
It turns out '.bat' is a valid batch file name. Reduce the permitted length for filenames to allow for this. Also, actually *use* the file basename in the test this time.
-rw-r--r--win32/mingw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 3398e3df4..da77dee36 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -1167,7 +1167,7 @@ static int has_win_suffix(const char *name, int start)
1167 const char *bname = bb_basename(name); 1167 const char *bname = bb_basename(name);
1168 int i, len = strlen(bname); 1168 int i, len = strlen(bname);
1169 1169
1170 if (len > 4 && name[len-4] == '.') { 1170 if (len > 3 && bname[len-4] == '.') {
1171 for (i=start; i<4; ++i) { 1171 for (i=start; i<4; ++i) {
1172 if (!strcasecmp(bname+len-3, win_suffix[i])) { 1172 if (!strcasecmp(bname+len-3, win_suffix[i])) {
1173 return 1; 1173 return 1;