index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2012-02-11 17:30:23 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-02-11 14:58:28 -0600 |
commit | 294f0fdf4df361e0d553eb650e1aacdb83f7bdf5 (patch) | |
tree | 266cd18e11ff81e73913b8e88182e9294b4b7d63 /src/util | |
parent | 31432edcbe484a5fca01abff77359061ae813fcc (diff) |
-rw-r--r-- | src/util/pactree.c | 12 |
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,17 +167,17 @@ static int register_syncs(void) { } while(fgets(line, LINE_MAX, fp)) { + /* ignore whole line and end of line comments */ + if((ptr = strchr(line, '#'))) { + *ptr = '\0'; + } + strtrim(line); - if(line[0] == '#' || !strlen(line)) { + if(strlen(line) == 0) { continue; } - if((ptr = strchr(line, '#'))) { - *ptr = '\0'; - strtrim(line); - } - if(line[0] == '[' && line[strlen(line) - 1] == ']') { free(section); section = strndup(&line[1], strlen(line) - 2); |