mdev: do not treat non-leading '#' chars as start of comment. Closes 4676
[oweals/busybox.git] / libbb / parse_config.c
index cf5ba4deb1473dff837b06d843f5c7a1292deecb..1590d9a4c0b346663b346432a67d21e90b685886 100644 (file)
@@ -204,7 +204,7 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const
                        line += strcspn(line, delims[0] ? delims : delims + 1);
                } else {
                        /* Combining, find comment char if any */
-                       line = strchrnul(line, delims[0]);
+                       line = strchrnul(line, PARSE_EOL_COMMENTS ? delims[0] : '\0');
 
                        /* Trim any extra delimiters from the end */
                        if (flags & PARSE_TRIM) {