diff options
author | ian <ian@FreeBSD.org> | 2014-11-23 19:13:17 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-11-23 19:13:17 +0000 |
commit | 7ef595c6e51b921d851c6c2ad382b943cdbf5ebf (patch) | |
tree | 4915f358815622ac86f616f16cbc5824f529f828 /usr.sbin | |
parent | 3f7fdcc87f407cee434ca54138673bd4ce6a7fa8 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.sbin/config/main.c | 5 |
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; |