aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 330de607f..90e9168be 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -9318,7 +9318,9 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c
9318 /* Treat all applets as NOEXEC, including the shell itself 9318 /* Treat all applets as NOEXEC, including the shell itself
9319 * if we were called from forkshell_shellexec(). */ 9319 * if we were called from forkshell_shellexec(). */
9320 run_noexec: 9320 run_noexec:
9321 if (applet_main[applet_no] != ash_main || noexec) { 9321 if ((applet_main[applet_no] != ash_main || noexec) &&
9322 fileno(stdin) != -2 && fileno(stdout) != -2 &&
9323 fileno(stderr) != -2) {
9322 /* mingw-w64's getopt() uses __argv[0] as the program name */ 9324 /* mingw-w64's getopt() uses __argv[0] as the program name */
9323 __argv[0] = (char *)cmd; 9325 __argv[0] = (char *)cmd;
9324 /* 'which' wants to know if it was invoked from a standalone 9326 /* 'which' wants to know if it was invoked from a standalone