1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-10-31 15:45:03 -04:00

pactree: allow comments after repo section header

Duplicate the fix in config file parsing from d95c0494.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-02-11 17:30:23 +10:00 committed by Dan McGee
parent 31432edcbe
commit 294f0fdf4d

View File

@ -167,15 +167,15 @@ static int register_syncs(void) {
}
while(fgets(line, LINE_MAX, fp)) {
strtrim(line);
if(line[0] == '#' || !strlen(line)) {
continue;
}
/* ignore whole line and end of line comments */
if((ptr = strchr(line, '#'))) {
*ptr = '\0';
strtrim(line);
}
strtrim(line);
if(strlen(line) == 0) {
continue;
}
if(line[0] == '[' && line[strlen(line) - 1] == ']') {