1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Allow redirections by themselves between "&&" and "||" operators.

For example, >/dev/null && echo foo

Pointed out by:	FUJISHIMA Satsuki
MFC after:	1 week
This commit is contained in:
Tim J. Robbins 2002-08-11 03:04:23 +00:00
parent 24befda40b
commit d8d737d751
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101662

View File

@ -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: