Handle ``!'' characters when they appear as second and subsequent

parts of an && or || expression.

This makes this expression work as expected:

	if true && ! false; then echo yes; fi
This commit is contained in:
Brian Somers 2001-04-04 09:30:50 +00:00
parent 355c6ef4b4
commit 51a9b1c281

View File

@ -256,13 +256,16 @@ pipeline() {
union node *n1, *pipenode, *notnode;
struct nodelist *lp, *prev;
int negate = 0;
int savecheckkwd = checkkwd;
TRACE(("pipeline: entered\n"));
checkkwd = 2;
while (readtoken() == TNOT) {
TRACE(("pipeline: TNOT recognized\n"));
negate = !negate;
}
tokpushback++;
checkkwd = savecheckkwd;
n1 = command();
if (readtoken() == TPIPE) {
pipenode = (union node *)stalloc(sizeof (struct npipe));