diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 9e861620e5f7..8dd1e7a72367 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -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;