summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-12-27 11:43:31 +0000
committerbrian <brian@FreeBSD.org>1999-12-27 11:43:31 +0000
commit8d3683f53b3d5744a2026aa9b81196dd6a4a4a1b (patch)
tree94166715268d35a6faf276b4828f0f243857c33c /usr.sbin/ppp/defs.c
parent216d01507f39e9ea892e22ba17d9f7bc780aca8b (diff)
downloadFreeBSD-src-8d3683f53b3d5744a2026aa9b81196dd6a4a4a1b.zip
FreeBSD-src-8d3683f53b3d5744a2026aa9b81196dd6a4a4a1b.tar.gz
Don't allowt '#' as a comment when it's embedded in quotes:
set something "xxx yyy # zzz" aaa shouldn't be interpreted as set something "xxx yyy" aaa
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r--usr.sbin/ppp/defs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c
index 31d355e..bf7492d 100644
--- a/usr.sbin/ppp/defs.c
+++ b/usr.sbin/ppp/defs.c
@@ -264,14 +264,14 @@ IntToSpeed(int nspeed)
}
char *
-findblank(char *p, int reduce)
+findblank(char *p, int flags)
{
int instring;
instring = 0;
while (*p) {
if (*p == '\\') {
- if (reduce) {
+ if (flags & PARSE_REDUCE) {
memmove(p, p + 1, strlen(p));
if (!*p)
break;
@@ -281,7 +281,8 @@ findblank(char *p, int reduce)
memmove(p, p + 1, strlen(p));
instring = !instring;
continue;
- } else if (!instring && (issep(*p) || *p == '#'))
+ } else if (!instring && (issep(*p) ||
+ (*p == '#' && !(flags & PARSE_NOHASH))))
return p;
p++;
}
@@ -290,7 +291,7 @@ findblank(char *p, int reduce)
}
int
-MakeArgs(char *script, char **pvect, int maxargs, int reduce)
+MakeArgs(char *script, char **pvect, int maxargs, int flags)
{
int nargs;
@@ -302,7 +303,7 @@ MakeArgs(char *script, char **pvect, int maxargs, int reduce)
break;
*pvect++ = script;
nargs++;
- script = findblank(script, reduce);
+ script = findblank(script, flags);
if (script == NULL)
return -1;
else if (*script == '#')
OpenPOWER on IntegriCloud