aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-08-11 18:43:02 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-08-11 18:43:02 +0200
commit1cd53c15a2b370487c7951345efff3b43f228d1d (patch)
tree6d289da6be4dcbb1d5fb00c74e1f4ad01ec276aa /shell
parent0da6c813e13eaf1cddfd7cbee1f3a5a4ffe58ec0 (diff)
downloadbusybox-w32-1cd53c15a2b370487c7951345efff3b43f228d1d.tar.gz
busybox-w32-1cd53c15a2b370487c7951345efff3b43f228d1d.tar.bz2
busybox-w32-1cd53c15a2b370487c7951345efff3b43f228d1d.zip
ash: parser: Invalid redirections are run-time, not syntax errors
Upstream commit Date: Wed, 14 Dec 2022 02:06:05 +0100 parser: Invalid redirections are run-time, not syntax errors 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 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index ad1b9fd9f..7a4f7c6a8 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12163,7 +12163,7 @@ fixredir(union node *n, const char *text, int err)
12163 * silently truncate results to word width. 12163 * silently truncate results to word width.
12164 */ 12164 */
12165 if (err) 12165 if (err)
12166 raise_error_syntax("bad fd number"); 12166 ash_msg_and_raise_error("bad fd number");
12167 n->ndup.vname = makename(); 12167 n->ndup.vname = makename();
12168 } 12168 }
12169} 12169}