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:
parent
31432edcbe
commit
294f0fdf4d
1 changed files with 7 additions and 7 deletions
|
@ -167,15 +167,15 @@ static int register_syncs(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
while(fgets(line, LINE_MAX, fp)) {
|
while(fgets(line, LINE_MAX, fp)) {
|
||||||
strtrim(line);
|
/* ignore whole line and end of line comments */
|
||||||
|
|
||||||
if(line[0] == '#' || !strlen(line)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((ptr = strchr(line, '#'))) {
|
if((ptr = strchr(line, '#'))) {
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
strtrim(line);
|
}
|
||||||
|
|
||||||
|
strtrim(line);
|
||||||
|
|
||||||
|
if(strlen(line) == 0) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(line[0] == '[' && line[strlen(line) - 1] == ']') {
|
if(line[0] == '[' && line[strlen(line) - 1] == ']') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue