Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2014 19:13:17 +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: r274924 - head/usr.sbin/config
Message-ID:  <201411231913.sANJDHK1030171@svn.freebsd.org>

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

Log:
  Consider the negation operator (!) to be a word even if it is not followed
  by whitespace.  This allows "optional !foo" which is what most programmers
  are naturally going to tend to do as opposed to "optional ! foo".

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

Modified: head/usr.sbin/config/main.c
==============================================================================
--- head/usr.sbin/config/main.c	Sun Nov 23 18:32:21 2014	(r274923)
+++ head/usr.sbin/config/main.c	Sun Nov 23 19:13:17 2014	(r274924)
@@ -314,6 +314,11 @@ begin:
 	}
 	cp = line;
 	*cp++ = ch;
+	/* Negation operator is a word by itself. */
+	if (ch == '!') {
+		*cp = 0;
+		return (line);
+	}
 	while ((ch = getc(fp)) != EOF) {
 		if (isspace(ch))
 			break;



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