ini.c: make errors in includes fatal
If an error in the main file would be fatal there is little reason to ignore the error in an included file. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
bf1c8e3a3c
commit
4d4f46ba2a
1 changed files with 5 additions and 1 deletions
|
@ -153,8 +153,12 @@ static int _parse_ini(const char *file, ini_parser_fn cb, void *data,
|
||||||
for(gindex = 0; gindex < globbuf.gl_pathc; gindex++) {
|
for(gindex = 0; gindex < globbuf.gl_pathc; gindex++) {
|
||||||
pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: including %s\n",
|
pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: including %s\n",
|
||||||
file, linenum, globbuf.gl_pathv[gindex]);
|
file, linenum, globbuf.gl_pathv[gindex]);
|
||||||
_parse_ini(globbuf.gl_pathv[gindex], cb, data,
|
ret =_parse_ini(globbuf.gl_pathv[gindex], cb, data,
|
||||||
section_name, line, depth + 1);
|
section_name, line, depth + 1);
|
||||||
|
if(ret) {
|
||||||
|
globfree(&globbuf);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue