From 0a2c4d20fe49c504b5bbb383afc97db340814bba Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 18 Aug 2014 12:27:22 +0200 Subject: Retain comments in descriptions and config values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comments should only be stripped if they start at the beginning of a line. We do not want to chop off an TODO item description or a configuration value. Reported-by: HÃ¥kan Jerning Signed-off-by: Lukas Fleischer --- src/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index cd9ca50..2e7d483 100644 --- a/src/config.c +++ b/src/config.c @@ -470,7 +470,7 @@ config_file_walk(config_fn_walk_cb_t fn_cb, break; io_extract_data(e_conf, buf, sizeof buf); - if (*e_conf == '\0') { + if (*e_conf == '\0' || *e_conf == '#') { if (fn_junk_cb) fn_junk_cb(buf, data); continue; @@ -517,6 +517,8 @@ config_file_walk(config_fn_walk_cb_t fn_cb, if (fgets(buf, sizeof buf, data_file) == NULL) break; io_extract_data(e_conf, buf, sizeof buf); + if (*e_conf == '#') + *e_conf = '\0'; value = e_conf; } -- cgit v1.2.3-54-g00ecf