summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/main.c
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-11-23 19:13:17 +0000
committerian <ian@FreeBSD.org>2014-11-23 19:13:17 +0000
commit7ef595c6e51b921d851c6c2ad382b943cdbf5ebf (patch)
tree4915f358815622ac86f616f16cbc5824f529f828 /usr.sbin/config/main.c
parent3f7fdcc87f407cee434ca54138673bd4ce6a7fa8 (diff)
downloadFreeBSD-src-7ef595c6e51b921d851c6c2ad382b943cdbf5ebf.zip
FreeBSD-src-7ef595c6e51b921d851c6c2ad382b943cdbf5ebf.tar.gz
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".
Diffstat (limited to 'usr.sbin/config/main.c')
-rw-r--r--usr.sbin/config/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 86ecfa6..ff18d3c 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -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;
OpenPOWER on IntegriCloud