diff options
author | jilles <jilles@FreeBSD.org> | 2014-11-22 23:28:41 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2014-11-22 23:28:41 +0000 |
commit | 6c8ea83ec558fc24d94e27f2623cdb9f1f16402a (patch) | |
tree | 673c2a4fa95dcf1d96ac37f731d07568798d8e81 /bin/sh/parser.c | |
parent | abfc69102bd74f26f145800e55f2511c69558425 (diff) | |
download | FreeBSD-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/parser.c')
-rw-r--r-- | bin/sh/parser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 7fae29e..0048314 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -1879,6 +1879,8 @@ synerror(const char *msg) { if (commandname) outfmt(out2, "%s: %d: ", commandname, startlinno); + else if (arg0) + outfmt(out2, "%s: ", arg0); outfmt(out2, "Syntax error: %s\n", msg); error((char *)NULL); } |