* 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))