summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-08-09 02:24:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-08-09 02:26:51 +0200
commit6d4476258993d82a14ec060c53e41199d2f5eef5 (patch)
tree259c483638a499a7898904b60b43402a6da8a80d /shell
parent98b1a000c98cc6e91bae702c2f2f3824bbd7420a (diff)
ash: options: Do not set commandname in procargs
Upstream commit: Date: Mon Feb 25 12:49:20 2019 +0800 options: Do not set commandname in procargs We set commandname in procargs when we don't have to. This results in a duplicated output of arg0 when an error occurs. function old new delta ash_main 1256 1236 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index e8ac07cf0..aaea641a9 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -1447,7 +1447,7 @@ ash_vmsg(const char *msg, va_list ap)
{
fprintf(stderr, "%s: ", arg0);
if (commandname) {
- if (strcmp(arg0, commandname))
+ if (strcmp(arg0, commandname) != 0)
fprintf(stderr, "%s: ", commandname);
if (!iflag || g_parsefile->pf_fd > 0)
fprintf(stderr, "line %d: ", errlinno);
@@ -14659,7 +14659,7 @@ procargs(char **argv)
int login_sh;
xargv = argv;
- login_sh = xargv[0] && xargv[0][0] == '-';
+ login_sh = /*xargv[0] &&*/ xargv[0][0] == '-';
#if NUM_SCRIPTS > 0
if (minusc)
goto setarg0;
@@ -14705,7 +14705,6 @@ procargs(char **argv)
setinputfile(*xargv, 0);
setarg0:
arg0 = *xargv++;
- commandname = arg0;
}
shellparam.p = xargv;