sh: Allow a lone redirection before '|', ';;' or ';&'.

Example: </dev/null | :

PR:		181240
MFC after:	1 week
This commit is contained in:
Jilles Tjoelker 2013-08-14 19:34:13 +00:00
parent a2bc8a1d0c
commit adc2e8dfb4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254335
4 changed files with 9 additions and 0 deletions

View file

@ -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 ;'.

View file

@ -0,0 +1,2 @@
# $FreeBSD$
</dev/null | :

View file

@ -0,0 +1,2 @@
# $FreeBSD$
case x in x) </dev/null ;; esac

View file

@ -0,0 +1,2 @@
# $FreeBSD$
case x in x) </dev/null ;& esac