aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 11:00:47 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 11:04:46 +1000
commit9375ca983262075d8420fd0d88d00a088916fc10 (patch)
treed6365d7687d1d149abb3f7ecfb5d1dc8e78283ba
parent76f3e88ccdcc9c5386e8491cb8d0e5305606f39e (diff)
downloadbusybox-w32-9375ca983262075d8420fd0d88d00a088916fc10.tar.gz
busybox-w32-9375ca983262075d8420fd0d88d00a088916fc10.tar.bz2
busybox-w32-9375ca983262075d8420fd0d88d00a088916fc10.zip
win32: ash: support .com executables
-rw-r--r--shell/ash.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index f43d1653f..5d8415a79 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12674,7 +12674,9 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
12674 } 12674 }
12675#if ENABLE_PLATFORM_MINGW32 12675#if ENABLE_PLATFORM_MINGW32
12676 len = strlen(fullname); 12676 len = strlen(fullname);
12677 if (len > 4 && !strcasecmp(fullname+len-4, ".exe")) { 12677 if (len > 4 &&
12678 (!strcasecmp(fullname+len-4, ".exe") ||
12679 !strcasecmp(fullname+len-4, ".com"))) {
12678 if (stat(fullname, &statb) < 0) { 12680 if (stat(fullname, &statb) < 0) {
12679 if (errno != ENOENT && errno != ENOTDIR) 12681 if (errno != ENOENT && errno != ENOTDIR)
12680 e = errno; 12682 e = errno;
@@ -12687,7 +12689,12 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
12687 if (stat(fullname, &statb) < 0) { 12689 if (stat(fullname, &statb) < 0) {
12688 if (errno != ENOENT && errno != ENOTDIR) 12690 if (errno != ENOENT && errno != ENOTDIR)
12689 e = errno; 12691 e = errno;
12690 goto loop; 12692 memcpy(fullname+len, ".com", 5);
12693 if (stat(fullname, &statb) < 0) {
12694 if (errno != ENOENT && errno != ENOTDIR)
12695 e = errno;
12696 goto loop;
12697 }
12691 } 12698 }
12692 fullname[len] = '\0'; 12699 fullname[len] = '\0';
12693 } 12700 }