summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-04-04 09:30:50 +0000
committerbrian <brian@FreeBSD.org>2001-04-04 09:30:50 +0000
commitdac2619941ccf2ba733ed8f13b95822e34a73465 (patch)
treee5e1216c788612bd4ade964a3a1815f3b9774ad0 /bin
parent5e26890919d9c7f9f9abcd73246b2fbe888569ee (diff)
downloadFreeBSD-src-dac2619941ccf2ba733ed8f13b95822e34a73465.zip
FreeBSD-src-dac2619941ccf2ba733ed8f13b95822e34a73465.tar.gz
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
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/parser.c3
1 files changed, 3 insertions, 0 deletions
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));
OpenPOWER on IntegriCloud