diff options
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/shell/ash.c b/shell/ash.c index d9a7bee83..5f231385a 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9104,11 +9104,9 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c | |||
9104 | #endif | 9104 | #endif |
9105 | #if ENABLE_FEATURE_SH_STANDALONE | 9105 | #if ENABLE_FEATURE_SH_STANDALONE |
9106 | if (applet_no >= 0) { | 9106 | if (applet_no >= 0) { |
9107 | if (ENABLE_PLATFORM_MINGW32 || APPLET_IS_NOEXEC(applet_no)) { | ||
9107 | # if ENABLE_PLATFORM_MINGW32 | 9108 | # if ENABLE_PLATFORM_MINGW32 |
9108 | /* Treat all applets as NOEXEC, including the shell itself if | 9109 | /* Treat all applets as NOEXEC */ |
9109 | * this is a FS_SHELLEXEC shell. */ | ||
9110 | if (applet_main[applet_no] != ash_main || | ||
9111 | (fs && fs->fpid == FS_SHELLEXEC)) { | ||
9112 | run_noexec: | 9110 | run_noexec: |
9113 | /* mingw-w64's getopt() uses __argv[0] as the program name */ | 9111 | /* mingw-w64's getopt() uses __argv[0] as the program name */ |
9114 | __argv[0] = (char *)cmd; | 9112 | __argv[0] = (char *)cmd; |
@@ -9117,8 +9115,6 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c | |||
9117 | if (strcmp(argv[0], "which") == 0) { | 9115 | if (strcmp(argv[0], "which") == 0) { |
9118 | argv[0] = (char *)"Which"; | 9116 | argv[0] = (char *)"Which"; |
9119 | } | 9117 | } |
9120 | # else | ||
9121 | if (APPLET_IS_NOEXEC(applet_no)) { | ||
9122 | # endif | 9118 | # endif |
9123 | #if !ENABLE_PLATFORM_MINGW32 || !defined(_UCRT) | 9119 | #if !ENABLE_PLATFORM_MINGW32 || !defined(_UCRT) |
9124 | /* If building for UCRT move this up into shellexec() to | 9120 | /* If building for UCRT move this up into shellexec() to |