From 294f0fdf4df361e0d553eb650e1aacdb83f7bdf5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 11 Feb 2012 17:30:23 +1000 Subject: [PATCH] pactree: allow comments after repo section header Duplicate the fix in config file parsing from d95c0494. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- src/util/pactree.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/util/pactree.c b/src/util/pactree.c index 997ba466..cee5433a 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -167,15 +167,15 @@ static int register_syncs(void) { } while(fgets(line, LINE_MAX, fp)) { - strtrim(line); - - if(line[0] == '#' || !strlen(line)) { - continue; - } - + /* ignore whole line and end of line comments */ if((ptr = strchr(line, '#'))) { *ptr = '\0'; - strtrim(line); + } + + strtrim(line); + + if(strlen(line) == 0) { + continue; } if(line[0] == '[' && line[strlen(line) - 1] == ']') {