From 53b3854e8141f4fc5fad10f180fc4fac2feee954 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 9 Aug 2025 17:04:16 +0200 Subject: [PATCH] ash: fix fallout of no-more-set commandname Testsuite reports lots of message mismatches, fix that Signed-off-by: Denys Vlasenko --- shell/ash.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/shell/ash.c b/shell/ash.c index f1339cf3c..3e393715b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -1445,13 +1445,14 @@ showtree(union node *n) static void ash_vmsg(const char *msg, va_list ap) { +//In dash, the order/format is different: +// arg0: LINENO: [commandname:] MSG +//If you fix it, change testsuite to match fprintf(stderr, "%s: ", arg0); - if (commandname) { - if (strcmp(arg0, commandname) != 0) - fprintf(stderr, "%s: ", commandname); - if (!iflag || g_parsefile->pf_fd > 0) - fprintf(stderr, "line %d: ", errlinno); - } + if (commandname && strcmp(arg0, commandname) != 0) + fprintf(stderr, "%s: ", commandname); + if (!iflag || g_parsefile->pf_fd > 0) + fprintf(stderr, "line %d: ", errlinno); vfprintf(stderr, msg, ap); newline_and_flush(stderr); }