mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
sh: Prepend "$0: " to error messages if there is no command name.
This commit is contained in:
parent
f28c40aee0
commit
fafeab4393
2 changed files with 4 additions and 0 deletions
|
|
@ -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 a new issue