From 9375ca983262075d8420fd0d88d00a088916fc10 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Tue, 14 Sep 2010 11:00:47 +1000 Subject: win32: ash: support .com executables --- shell/ash.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'shell') 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) } #if ENABLE_PLATFORM_MINGW32 len = strlen(fullname); - if (len > 4 && !strcasecmp(fullname+len-4, ".exe")) { + if (len > 4 && + (!strcasecmp(fullname+len-4, ".exe") || + !strcasecmp(fullname+len-4, ".com"))) { if (stat(fullname, &statb) < 0) { if (errno != ENOENT && errno != ENOTDIR) e = errno; @@ -12687,7 +12689,12 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) if (stat(fullname, &statb) < 0) { if (errno != ENOENT && errno != ENOTDIR) e = errno; - goto loop; + memcpy(fullname+len, ".com", 5); + if (stat(fullname, &statb) < 0) { + if (errno != ENOENT && errno != ENOTDIR) + e = errno; + goto loop; + } } fullname[len] = '\0'; } -- cgit v1.2.3-55-g6feb