summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-13 10:12:39 -0600
committerDan McGee <dan@archlinux.org>2012-02-13 10:14:06 -0600
commitc7321a7b80aebeacb05ad5ab9d096779403b1758 (patch)
tree8fa7f16abc7b7af0c24ba92ababfc5c145d35eed /src/util
parent115c0381c235100d7b05d9751767017a9ee325c4 (diff)
parentb4f5a63e7fee5d04949e290bd63e5f0e94bd211e (diff)
downloadpacman-c7321a7b80aebeacb05ad5ab9d096779403b1758.tar.xz
Merge branch 'maint'
Conflicts: lib/libalpm/sync.c src/util/pactree.c
Diffstat (limited to 'src/util')
-rw-r--r--src/util/pactree.c12
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);