summaryrefslogtreecommitdiffstats
path: root/bin/sh/error.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2014-11-22 23:28:41 +0000
committerjilles <jilles@FreeBSD.org>2014-11-22 23:28:41 +0000
commit6c8ea83ec558fc24d94e27f2623cdb9f1f16402a (patch)
tree673c2a4fa95dcf1d96ac37f731d07568798d8e81 /bin/sh/error.c
parentabfc69102bd74f26f145800e55f2511c69558425 (diff)
downloadFreeBSD-src-6c8ea83ec558fc24d94e27f2623cdb9f1f16402a.zip
FreeBSD-src-6c8ea83ec558fc24d94e27f2623cdb9f1f16402a.tar.gz
sh: Prepend "$0: " to error messages if there is no command name.
Diffstat (limited to 'bin/sh/error.c')
-rw-r--r--bin/sh/error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sh/error.c b/bin/sh/error.c
index c76a9dc..96a0092 100644
--- a/bin/sh/error.c
+++ b/bin/sh/error.c
@@ -139,6 +139,8 @@ vwarning(const char *msg, va_list ap)
{
if (commandname)
outfmt(out2, "%s: ", commandname);
+ else if (arg0)
+ outfmt(out2, "%s: ", arg0);
doformat(out2, msg, ap);
out2fmt_flush("\n");
}
OpenPOWER on IntegriCloud