X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/blobdiff_plain/fdcbba2bd97ac1bb512f820755602afc8a1e7c7e..9c4bfd8cd15f0cfcf774313ac84513f6ba6f366d:/config.c diff --git a/config.c b/config.c index 42a0384..2b510b9 100644 --- a/config.c +++ b/config.c @@ -351,13 +351,23 @@ void bti_parse_configfile(struct session *session) * marker if it occurs at the beginning of the line, or after * whitespace */ - hashmarker = strchrnul(line, '#'); + hashmarker = strchr(line, '#'); if (line == hashmarker) line[0] = '\0'; else { - --hashmarker; - if (isblank(hashmarker[0])) - hashmarker[0] = '\0'; + while (hashmarker != NULL) { + --hashmarker; + if (isblank(hashmarker[0])) { + hashmarker[0] = '\0'; + break; + } else { + /* + * false positive; '#' occured + * within a string + */ + hashmarker = strchr(hashmarker+2, '#'); + } + } } c = line; while (isspace(*c))