From dac2619941ccf2ba733ed8f13b95822e34a73465 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 4 Apr 2001 09:30:50 +0000 Subject: 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 --- bin/sh/parser.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'bin/sh/parser.c') diff --git a/bin/sh/parser.c b/bin/sh/parser.c index 08d2569..9164b60 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -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)); -- cgit v1.1