From dc38829e3ba8688fee7c0aff7d419ac6b01d4f7e Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Sat, 19 Mar 2011 12:41:01 +0100 Subject: [PATCH] Keep searching for '#' comment marker if previous occurence was a false positive --- config.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index 42a0384..e06f480 100644 --- a/config.c +++ b/config.c @@ -355,9 +355,18 @@ void bti_parse_configfile(struct session *session) if (line == hashmarker) line[0] = '\0'; else { - --hashmarker; - if (isblank(hashmarker[0])) - hashmarker[0] = '\0'; + while (hashmarker[0] != '\0') { + --hashmarker; + if (isblank(hashmarker[0])) + hashmarker[0] = '\0'; + else { + /* + * false positive; '#' occured + * within a string + */ + hashmarker = strchrnul(hashmarker+2, '#'); + } + } } c = line; while (isspace(*c)) -- 2.39.5