From: Michel Alexandre Salim Date: Sat, 19 Mar 2011 11:41:01 +0000 (+0100) Subject: Keep searching for '#' comment marker if previous occurence was a false positive X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/dc38829e3ba8688fee7c0aff7d419ac6b01d4f7e Keep searching for '#' comment marker if previous occurence was a false positive --- 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))