sh: Show more information about syntax errors in command substitution:
the line number where the command substitution started. This applies to both the $() and `` forms but is most useful for `` because the other line number is relative to the enclosed text there. (For older versions, -v can be used as a workaround.)
This commit is contained in:
parent
7024354df3
commit
f6196ed2d4
@ -1308,11 +1308,16 @@ parsebackq: {
|
||||
struct jmploc *const savehandler = handler;
|
||||
int savelen;
|
||||
int saveprompt;
|
||||
const int bq_startlinno = plinno;
|
||||
|
||||
if (setjmp(jmploc.loc)) {
|
||||
if (str)
|
||||
ckfree(str);
|
||||
handler = savehandler;
|
||||
if (exception == EXERROR) {
|
||||
startlinno = bq_startlinno;
|
||||
synerror("Error in command substitution");
|
||||
}
|
||||
longjmp(handler->loc, 1);
|
||||
}
|
||||
INTOFF;
|
||||
|
Loading…
Reference in New Issue
Block a user