diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 00:40:36 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-20 19:14:38 +0200 |
commit | 2966e4a8aa09d4dacab5338f058999d602c4b102 (patch) | |
tree | d08ded3f37273109eb20390ace61856a80299f5e /shell | |
parent | ceef077aea62b57e8d97bbdc4f16a045236907e3 (diff) | |
download | busybox-w32-2966e4a8aa09d4dacab5338f058999d602c4b102.tar.gz busybox-w32-2966e4a8aa09d4dacab5338f058999d602c4b102.tar.bz2 busybox-w32-2966e4a8aa09d4dacab5338f058999d602c4b102.zip |
win32: ash: shellexec(): support both / and \ as dir separator
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 05ca74579..85d8f18a5 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -7300,7 +7300,7 @@ shellexec(char **argv, const char *path, int idx) | |||
7300 | 7300 | ||
7301 | clearredir(/*drop:*/ 1); | 7301 | clearredir(/*drop:*/ 1); |
7302 | envp = listvars(VEXPORT, VUNSET, 0); | 7302 | envp = listvars(VEXPORT, VUNSET, 0); |
7303 | if (strchr(argv[0], '/') != NULL | 7303 | if ((strchr(argv[0], '/') || (ENABLE_PLATFORM_MINGW32 && strchr(argv[0], '\\'))) |
7304 | #if ENABLE_FEATURE_SH_STANDALONE | 7304 | #if ENABLE_FEATURE_SH_STANDALONE |
7305 | || (applet_no = find_applet_by_name(argv[0])) >= 0 | 7305 | || (applet_no = find_applet_by_name(argv[0])) >= 0 |
7306 | #endif | 7306 | #endif |
@@ -12000,7 +12000,7 @@ find_dot_file(char *name) | |||
12000 | struct stat statb; | 12000 | struct stat statb; |
12001 | 12001 | ||
12002 | /* don't try this for absolute or relative paths */ | 12002 | /* don't try this for absolute or relative paths */ |
12003 | if (strchr(name, '/')) | 12003 | if (strchr(name, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(name, '\\'))) |
12004 | return name; | 12004 | return name; |
12005 | 12005 | ||
12006 | /* IIRC standards do not say whether . is to be searched. | 12006 | /* IIRC standards do not say whether . is to be searched. |
@@ -12103,10 +12103,11 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) | |||
12103 | struct stat statb; | 12103 | struct stat statb; |
12104 | int e; | 12104 | int e; |
12105 | int updatetbl; | 12105 | int updatetbl; |
12106 | IF_PLATFORM_MINGW32(int len); | ||
12106 | struct builtincmd *bcmd; | 12107 | struct builtincmd *bcmd; |
12107 | 12108 | ||
12108 | /* If name contains a slash, don't use PATH or hash table */ | 12109 | /* If name contains a slash, don't use PATH or hash table */ |
12109 | if (strchr(name, '/') != NULL) { | 12110 | if (strchr(name, '/') || (ENABLE_PLATFORM_MINGW32 && strchr(name, '\\'))) { |
12110 | entry->u.index = -1; | 12111 | entry->u.index = -1; |
12111 | if (act & DO_ABS) { | 12112 | if (act & DO_ABS) { |
12112 | while (stat(name, &statb) < 0) { | 12113 | while (stat(name, &statb) < 0) { |