summaryrefslogtreecommitdiffstats
path: root/src/util/pactree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/pactree.c')
-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 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);