diff options
Diffstat (limited to 'src/util/pactree.c')
-rw-r--r-- | src/util/pactree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/pactree.c b/src/util/pactree.c index a7dab9f1..aa02c808 100644 --- a/src/util/pactree.c +++ b/src/util/pactree.c @@ -168,17 +168,17 @@ static int register_syncs(void) { size_t linelen; char *ptr; + /* ignore whole line and end of line comments */ + if((ptr = strchr(line, '#'))) { + *ptr = '\0'; + } + linelen = strtrim(line); - if(line[0] == '#' || !linelen) { + if(linelen == 0) { continue; } - if((ptr = strchr(line, '#'))) { - *ptr = '\0'; - linelen = strtrim(line); - } - if(line[0] == '[' && line[linelen - 1] == ']') { free(section); section = strndup(&line[1], linelen - 2); |