From 499597d6efb0de5bb6d6f52bda1f348478d7f5a9 Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Wed, 11 Jan 2012 00:37:17 +0100
Subject: mdev: do not treat non-leading '#' chars as start of comment. Closes
 4676

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 libbb/parse_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'libbb')

diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index cf5ba4deb..1590d9a4c 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -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) {
-- 
cgit v1.2.3-55-g6feb