This fixes a long-standing bug where echo 'echo >&a' | sh errors out with sh: 2: Syntax error: Bad fd number despite the error being on line 1 This patch makes the error sh: 1: Bad fd number: a as expected Adapted-from: https://github.com/hvdijk/gwsh/commit/d279523041c1c380d64b6dec7760feba20bbf6b5 --- src/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.c b/src/parser.c index a552c47..8a06b9e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -615,7 +615,7 @@ void fixredir(union node *n, const char *text, int err) else { if (err) - synerror("Bad fd number"); + sh_error("Bad fd number: %s", text); else n->ndup.vname = makename(); } -- 2.30.2
Attachment:
signature.asc
Description: PGP signature