summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-11-23 23:58:47 +0000
committerian <ian@FreeBSD.org>2014-11-23 23:58:47 +0000
commite55461bc073856adc072a5584f21506d6636e5fd (patch)
treede903684749c37edf6805cfca9c056b728d6d614 /usr.sbin/config
parentff5b0516488df0919b34cf90558022f6403e0916 (diff)
downloadFreeBSD-src-e55461bc073856adc072a5584f21506d6636e5fd.zip
FreeBSD-src-e55461bc073856adc072a5584f21506d6636e5fd.tar.gz
Fix the negation (!) operator so that it binds only to the word that
immediately follows it, which means 'not' has to be reset every time an option word or device name is processed.
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/mkmakefile.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c
index cae2efc..0f873c4 100644
--- a/usr.sbin/config/mkmakefile.c
+++ b/usr.sbin/config/mkmakefile.c
@@ -386,13 +386,9 @@ next:
if (nreqs == 0)
errout("%s: syntax error describing %s\n",
fname, this);
- if (not)
- compile += !match;
- else
- compile += match;
+ compile += match;
match = 1;
nreqs = 0;
- not = 0;
continue;
}
if (eq(wd, "no-obj")) {
@@ -474,19 +470,23 @@ next:
this, wd);
STAILQ_FOREACH(dp, &dtab, d_next)
if (eq(dp->d_name, wd)) {
- dp->d_done |= DEVDONE;
+ if (not)
+ match = 0;
+ else
+ dp->d_done |= DEVDONE;
goto nextparam;
}
SLIST_FOREACH(op, &opt, op_next)
- if (op->op_value == 0 && opteq(op->op_name, wd))
+ if (op->op_value == 0 && opteq(op->op_name, wd)) {
+ if (not)
+ match = 0;
goto nextparam;
- match = 0;
+ }
+ match &= not;
nextparam:;
+ not = 0;
}
- if (not)
- compile += !match;
- else
- compile += match;
+ compile += match;
if (compile && tp == NULL) {
if (std == 0 && nreqs == 0)
errout("%s: what is %s optional on?\n",
OpenPOWER on IntegriCloud