summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-08-14 19:34:13 +0000
committerjilles <jilles@FreeBSD.org>2013-08-14 19:34:13 +0000
commit79360f25fc862bef26d62d9fd2ec20d0de41756e (patch)
tree62ccfcc3c8d54aa063ad08d8afd4497008271b6c /bin/sh
parent521440b2991bdc998552fdaf12e9ba82e5c9c053 (diff)
downloadFreeBSD-src-79360f25fc862bef26d62d9fd2ec20d0de41756e.zip
FreeBSD-src-79360f25fc862bef26d62d9fd2ec20d0de41756e.tar.gz
sh: Allow a lone redirection before '|', ';;' or ';&'.
Example: </dev/null | : PR: 181240 MFC after: 1 week
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index f079c69c..ec15f58 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -577,6 +577,9 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
case TSEMI:
case TAND:
case TOR:
+ case TPIPE:
+ case TENDCASE:
+ case TFALLTHRU:
/*
* An empty command before a ; doesn't make much sense, and
* should certainly be disallowed in the case of `if ;'.
OpenPOWER on IntegriCloud