mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-21 09:13:37 +00:00
sh: Allow a lone redirection before '|', ';;' or ';&'.
Example: </dev/null | : PR: 181240 MFC after: 1 week
This commit is contained in:
parent
a2bc8a1d0c
commit
adc2e8dfb4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254335
|
@ -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 ;'.
|
||||
|
|
2
tools/regression/bin/sh/parser/only-redir2.0
Normal file
2
tools/regression/bin/sh/parser/only-redir2.0
Normal file
|
@ -0,0 +1,2 @@
|
|||
# $FreeBSD$
|
||||
</dev/null | :
|
2
tools/regression/bin/sh/parser/only-redir3.0
Normal file
2
tools/regression/bin/sh/parser/only-redir3.0
Normal file
|
@ -0,0 +1,2 @@
|
|||
# $FreeBSD$
|
||||
case x in x) </dev/null ;; esac
|
2
tools/regression/bin/sh/parser/only-redir4.0
Normal file
2
tools/regression/bin/sh/parser/only-redir4.0
Normal file
|
@ -0,0 +1,2 @@
|
|||
# $FreeBSD$
|
||||
case x in x) </dev/null ;& esac
|
Loading…
Reference in a new issue