From owner-svn-src-all@FreeBSD.ORG  Sun Nov 23 23:58:48 2014
Return-Path: <owner-svn-src-all@FreeBSD.ORG>
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 66457BD4;
 Sun, 23 Nov 2014 23:58:48 +0000 (UTC)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 52CE1961;
 Sun, 23 Nov 2014 23:58:48 +0000 (UTC)
Received: from svn.freebsd.org ([127.0.1.70])
 by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sANNwm7c064746;
 Sun, 23 Nov 2014 23:58:48 GMT (envelope-from ian@FreeBSD.org)
Received: (from ian@localhost)
 by svn.freebsd.org (8.14.9/8.14.9/Submit) id sANNwmuW064745;
 Sun, 23 Nov 2014 23:58:48 GMT (envelope-from ian@FreeBSD.org)
Message-Id: <201411232358.sANNwmuW064745@svn.freebsd.org>
X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org
 using -f
From: Ian Lepore <ian@FreeBSD.org>
Date: Sun, 23 Nov 2014 23:58:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r274936 - head/usr.sbin/config
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 23 Nov 2014 23:58:48 -0000

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",