From e8a8c768600260f9b9296265759ff49c84ec43f9 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 8 Nov 2006 07:07:25 +0000 Subject: [PATCH] Skip comment lines in config file starting with '#' or ';' correctly SVN revision: 1745 --- src/elogd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/elogd.c b/src/elogd.c index 20d61675..066362aa 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -2806,7 +2806,11 @@ int parse_config_file(char *file_name) p = buffer; index = 0; do { - if (*p == '[') { + if (*p == '#' || *p == ';') { + /* skip comment */ + while (*p && *p != '\n' && *p != '\r') + p++; + } else if (*p == '[') { p++; pstr = str; while (*p && *p != ']' && *p != '\n' && *p != '\r' && pstr - str < 10000)