index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2012-02-13 10:12:39 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-02-13 10:14:06 -0600 |
commit | c7321a7b80aebeacb05ad5ab9d096779403b1758 (patch) | |
tree | 8fa7f16abc7b7af0c24ba92ababfc5c145d35eed /src/util/pactree.c | |
parent | 115c0381c235100d7b05d9751767017a9ee325c4 (diff) | |
parent | b4f5a63e7fee5d04949e290bd63e5f0e94bd211e (diff) |
-rw-r--r-- | src/util/pactree.c | 12 |
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); |