aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/error.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2014-11-22 23:28:41 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2014-11-22 23:28:41 +0000
commitfafeab43932d054c05f63feb9f8bf2ef33f292f7 (patch)
tree673c2a4fa95dcf1d96ac37f731d07568798d8e81 /bin/sh/error.c
parentf28c40aee0192282c0be8c8ee3a61e5a59003750 (diff)
downloadsrc-fafeab43932d054c05f63feb9f8bf2ef33f292f7.tar.gz
src-fafeab43932d054c05f63feb9f8bf2ef33f292f7.zip
sh: Prepend "$0: " to error messages if there is no command name.
Notes
Notes: svn path=/head/; revision=274899
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 c76a9dc65768..96a0092d5bb0 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");
}