diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 913f0ce22..521ab22af 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9088,6 +9088,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) | |||
9088 | || (applet_no = find_applet_by_name(prog)) >= 0 | 9088 | || (applet_no = find_applet_by_name(prog)) >= 0 |
9089 | #endif | 9089 | #endif |
9090 | ) { | 9090 | ) { |
9091 | prog = stack_add_ext_space(prog); | ||
9091 | tryexec(IF_FEATURE_SH_STANDALONE(applet_no,) prog, argv, envp); | 9092 | tryexec(IF_FEATURE_SH_STANDALONE(applet_no,) prog, argv, envp); |
9092 | if (applet_no >= 0) { | 9093 | if (applet_no >= 0) { |
9093 | /* We tried execing ourself, but it didn't work. | 9094 | /* We tried execing ourself, but it didn't work. |
@@ -9098,7 +9099,7 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) | |||
9098 | } | 9099 | } |
9099 | e = errno; | 9100 | e = errno; |
9100 | #if ENABLE_PLATFORM_MINGW32 | 9101 | #if ENABLE_PLATFORM_MINGW32 |
9101 | if (unix_path(prog) && !find_builtin(bb_basename(prog))) { | 9102 | if (unix_path(prog)) { |
9102 | # if ENABLE_FEATURE_SH_STANDALONE | 9103 | # if ENABLE_FEATURE_SH_STANDALONE |
9103 | const char *name = bb_basename(prog); | 9104 | const char *name = bb_basename(prog); |
9104 | if ((applet_no = find_applet_by_name(name)) >= 0) { | 9105 | if ((applet_no = find_applet_by_name(name)) >= 0) { |
@@ -9106,8 +9107,10 @@ static void shellexec(char *prog, char **argv, const char *path, int idx) | |||
9106 | e = errno; | 9107 | e = errno; |
9107 | } | 9108 | } |
9108 | # endif | 9109 | # endif |
9109 | argv[0] = (char *)bb_basename(prog); | 9110 | if (!find_builtin(bb_basename(prog))) { |
9110 | goto try_PATH; | 9111 | argv[0] = (char *)bb_basename(prog); |
9112 | goto try_PATH; | ||
9113 | } | ||
9111 | } | 9114 | } |
9112 | #endif | 9115 | #endif |
9113 | } else { | 9116 | } else { |