Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2014 23:58:48 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274936 - head/usr.sbin/config
Message-ID:  <201411232358.sANNwmuW064745@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Nov 23 23:58:47 2014
New Revision: 274936
URL: https://svnweb.freebsd.org/changeset/base/274936

Log:
  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.

Modified:
  head/usr.sbin/config/mkmakefile.c

Modified: head/usr.sbin/config/mkmakefile.c
==============================================================================
--- head/usr.sbin/config/mkmakefile.c	Sun Nov 23 23:56:01 2014	(r274935)
+++ head/usr.sbin/config/mkmakefile.c	Sun Nov 23 23:58:47 2014	(r274936)
@@ -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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411232358.sANNwmuW064745>