diff options
-rw-r--r-- | shell/ash.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index a646522d6..f21ef85d4 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -11762,6 +11762,9 @@ evalcommand(union node *cmd, int flags) | |||
11762 | int applet_no = (- cmdentry.u.index - 2); | 11762 | int applet_no = (- cmdentry.u.index - 2); |
11763 | if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) { | 11763 | if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) { |
11764 | char **sv_environ; | 11764 | char **sv_environ; |
11765 | #if ENABLE_PLATFORM_MINGW32 | ||
11766 | char *sv_argv0; | ||
11767 | #endif | ||
11765 | 11768 | ||
11766 | INT_OFF; | 11769 | INT_OFF; |
11767 | sv_environ = environ; | 11770 | sv_environ = environ; |
@@ -11775,10 +11778,15 @@ evalcommand(union node *cmd, int flags) | |||
11775 | * for example, "yes" or "rm" (rm -i waits for input). | 11778 | * for example, "yes" or "rm" (rm -i waits for input). |
11776 | */ | 11779 | */ |
11777 | #if ENABLE_PLATFORM_MINGW32 | 11780 | #if ENABLE_PLATFORM_MINGW32 |
11781 | sv_argv0 = __argv[0]; | ||
11778 | argv[0] = (char *)bb_basename(argv[0]); | 11782 | argv[0] = (char *)bb_basename(argv[0]); |
11783 | __argv[0] = argv[0]; | ||
11779 | #endif | 11784 | #endif |
11780 | exitstatus = run_nofork_applet(applet_no, argv); | 11785 | exitstatus = run_nofork_applet(applet_no, argv); |
11781 | environ = sv_environ; | 11786 | environ = sv_environ; |
11787 | #if ENABLE_PLATFORM_MINGW32 | ||
11788 | __argv[0] = sv_argv0; | ||
11789 | #endif | ||
11782 | /* | 11790 | /* |
11783 | * Try enabling NOFORK for "yes" applet. | 11791 | * Try enabling NOFORK for "yes" applet. |
11784 | * ^C _will_ stop it (write returns EINTR), | 11792 | * ^C _will_ stop it (write returns EINTR), |