diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 02:57:58 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:31 +1000 |
commit | 97b3a0ad578463c8fa64e8b38d096cd91dde841e (patch) | |
tree | e22dcd504291fdffa0364aeb1eebf3be55720aa1 | |
parent | 855015f3293cdd0000e4b1b3a236995ca8780435 (diff) | |
download | busybox-w32-97b3a0ad578463c8fa64e8b38d096cd91dde841e.tar.gz busybox-w32-97b3a0ad578463c8fa64e8b38d096cd91dde841e.tar.bz2 busybox-w32-97b3a0ad578463c8fa64e8b38d096cd91dde841e.zip |
path_lookup(): look for .exe in absolute path too
-rw-r--r-- | libbb/mingw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libbb/mingw.c b/libbb/mingw.c index d3a2fc7f4..88d4f90e4 100644 --- a/libbb/mingw.c +++ b/libbb/mingw.c | |||
@@ -618,8 +618,15 @@ static char *path_lookup(const char *cmd, char **path, int exe_only) | |||
618 | int len = strlen(cmd); | 618 | int len = strlen(cmd); |
619 | int isexe = len >= 4 && !strcasecmp(cmd+len-4, ".exe"); | 619 | int isexe = len >= 4 && !strcasecmp(cmd+len-4, ".exe"); |
620 | 620 | ||
621 | if (strchr(cmd, '/') || strchr(cmd, '\\')) | 621 | if (strchr(cmd, '/') || strchr(cmd, '\\')) { |
622 | if (!isexe) { | ||
623 | char path[MAX_PATH]; | ||
624 | sprintf(path, "%s.exe", cmd); | ||
625 | if (!access(path, F_OK)) | ||
626 | return xstrdup(path); | ||
627 | } | ||
622 | prog = xstrdup(cmd); | 628 | prog = xstrdup(cmd); |
629 | } | ||
623 | 630 | ||
624 | while (!prog && *path) | 631 | while (!prog && *path) |
625 | prog = lookup_prog(*path++, cmd, isexe, exe_only); | 632 | prog = lookup_prog(*path++, cmd, isexe, exe_only); |