sh: Prepend "$0: " to error messages if there is no command name.
This commit is contained in:
parent
f28c40aee0
commit
fafeab4393
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274899
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user