svn commit: r274924 - head/usr.sbin/config

Ian Lepore ian at FreeBSD.org
Sun Nov 23 19:13:18 UTC 2014


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;


More information about the svn-src-head mailing list