summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-08-11 03:04:23 +0000
committertjr <tjr@FreeBSD.org>2002-08-11 03:04:23 +0000
commit717dc062a83546fbafc136b6b0cb837e693598eb (patch)
tree1bbe9702315bdb4ac436d696e7d00a1f959c31e2 /bin/sh
parent9c2a740b94eae5ca63cb355ba0ae1e1e92bc0b0c (diff)
downloadFreeBSD-src-717dc062a83546fbafc136b6b0cb837e693598eb.zip
FreeBSD-src-717dc062a83546fbafc136b6b0cb837e693598eb.tar.gz
Allow redirections by themselves between "&&" and "||" operators.
For example, >/dev/null && echo foo Pointed out by: FUJISHIMA Satsuki MFC after: 1 week
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/parser.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index 84288b8..e87047f 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -478,15 +478,14 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
break;
/* Handle an empty command like other simple commands. */
case TSEMI:
+ case TAND:
+ case TOR:
/*
* An empty command before a ; doesn't make much sense, and
* should certainly be disallowed in the case of `if ;'.
*/
if (!redir)
synexpect(-1);
- case TAND:
- case TOR:
- synexpect(-1);
case TNL:
case TEOF:
case TWORD:
OpenPOWER on IntegriCloud