sres.c: handle end-of-line comments (SFSIP-152)

Ignore-this: 8c79d2fbd6c0d4113c341c71ab615de2

darcs-hash:20090924141330-96d5a-e0099eaefbacb2d4b589787eeb4ebdfe1f10133b.gz
parent 2232ed23
......@@ -2282,11 +2282,11 @@ int sres_parse_config(sres_config_t *c, FILE *f)
/* Skip whitespace at the beginning ...*/
b = buf + strspn(buf, " \t");
/* ... and at the end of line */
for (len = strlen(b); len > 0 && strchr(" \t\r\n", b[len - 1]); len--)
/* ... and comments + whitespace at the end */
for (len = strcspn(b, "#;"); len && strchr(" \t\r\n", b[len - 1]); len--)
;
if (len == 0 || b[0] == '#') /* Empty line or comment */
if (len == 0) /* Empty line or comment */
continue;
b[len] = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment