aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-04-22 07:54:34 +0100
committerRon Yorston <rmy@pobox.com>2024-04-22 07:54:34 +0100
commitb5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f (patch)
treee1a23e01cdffe3128c44d6e41f86c17c43782202 /shell/ash.c
parentacda99ca9984570b03825c295a5617e67f0c1d7c (diff)
downloadbusybox-w32-b5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f.tar.gz
busybox-w32-b5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f.tar.bz2
busybox-w32-b5131ae1c0bb7984b35c909d04e2f4a61a7b6d8f.zip
win32: adjust handling of executable extensions
Mixing Windows and Unix-style filename extensions was causing problems. Tweak how extensions are handled to try and improve matters: - Consistently check whether the unaltered filename is an executable before trying adding extensions. - Check .exe and .com before .sh. Saves up to 16 bytes. (GitHub issue #405)
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index dc2115414..e32731d41 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -15059,7 +15059,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
15059 entry->u.index = -1; 15059 entry->u.index = -1;
15060 entry->cmdtype = CMDNORMAL; 15060 entry->cmdtype = CMDNORMAL;
15061 fullname = stack_add_ext_space(name); 15061 fullname = stack_add_ext_space(name);
15062 if (add_win32_extension(fullname) || file_is_executable(fullname)) { 15062 if (add_win32_extension(fullname)) {
15063 return; 15063 return;
15064 } else if (unix_path(name)) { 15064 } else if (unix_path(name)) {
15065 name = (char *)bb_basename(name); 15065 name = (char *)bb_basename(name);