aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-10-28 08:52:51 +0000
committerRon Yorston <rmy@pobox.com>2024-10-28 08:52:51 +0000
commitb4684bee87cb4acf392f27003c702d6650eda469 (patch)
tree3e208061c22117c00f7099f4e86206fff11b536c
parente697a94a2d19c1e74dc2efb168f4c40aeb30e446 (diff)
downloadbusybox-w32-b4684bee87cb4acf392f27003c702d6650eda469.tar.gz
busybox-w32-b4684bee87cb4acf392f27003c702d6650eda469.tar.bz2
busybox-w32-b4684bee87cb4acf392f27003c702d6650eda469.zip
ash: correctly identify nofork applets in error message
Commit 633e3a5eae (ash: correctly identify applet in getopt() error messages) made getopt() display the correct name for noexec applets in case of error. Do the same for nofork applets. Adds 32-48 bytes.
-rw-r--r--shell/ash.c8
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),