`|'' should be more binding than `!'' so that this isn't broken:

if ! echo bla | wc -c ; then
		echo broken
	fi

Obtained from: NetBSD
This commit is contained in:
brian 2001-04-09 12:46:19 +00:00
parent e8d6cf8f4b
commit 758d5927b5

View File

@ -253,10 +253,15 @@ andor() {
STATIC union node *
pipeline() {
union node *n1, *pipenode;
union node *n1, *n2, *pipenode;
struct nodelist *lp, *prev;
int negate;
negate = 0;
TRACE(("pipeline: entered\n"));
while (readtoken() == TNOT)
negate = !negate;
tokpushback++;
n1 = command();
if (readtoken() == TPIPE) {
pipenode = (union node *)stalloc(sizeof (struct npipe));
@ -275,7 +280,13 @@ pipeline() {
n1 = pipenode;
}
tokpushback++;
return n1;
if (negate) {
n2 = (union node *)stalloc(sizeof (struct nnot));
n2->type = NNOT;
n2->nnot.com = n1;
return n2;
} else
return n1;
}