diff options
author | brian <brian@FreeBSD.org> | 2000-08-30 20:51:13 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-08-30 20:51:13 +0000 |
commit | 543225026f371845ba9f8c75313b688c1a820cb7 (patch) | |
tree | 4c86f439861ef813630dfc7fcdf6bf449ecbc923 /usr.sbin/ppp | |
parent | 50a3c4fd88aad613b575bf8a49d0cda2de148164 (diff) | |
download | FreeBSD-src-543225026f371845ba9f8c75313b688c1a820cb7.zip FreeBSD-src-543225026f371845ba9f8c75313b688c1a820cb7.tar.gz |
Don't treat two or more whitespace followed by a comment as
an empty argument
PR: 20937 (maybe)
PR: 20938
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/defs.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c index a77823c..033ec14 100644 --- a/usr.sbin/ppp/defs.c +++ b/usr.sbin/ppp/defs.c @@ -302,20 +302,25 @@ MakeArgs(char *script, char **pvect, int maxargs, int flags) int nargs; nargs = 0; - while (*script && (*script != '#' || (flags & PARSE_NOHASH))) { + while (*script) { script += strspn(script, " \t"); + if (*script == '#' && flags & PARSE_NOHASH) { + *script = '\0'; + break; + } if (*script) { if (nargs >= maxargs - 1) - break; + break; *pvect++ = script; nargs++; script = findblank(script, flags); if (script == NULL) return -1; - else if (!(flags & PARSE_NOHASH) && *script == '#') - *script = '\0'; - else if (*script) - *script++ = '\0'; + else if (!(flags & PARSE_NOHASH) && *script == '#') { + *script = '\0'; + nargs--; + } else if (*script) + *script++ = '\0'; } } *pvect = NULL; |