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 <[email protected]>
---
 src/pacman/ini.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pacman/ini.c b/src/pacman/ini.c
index 95c85a5..c2399ba 100644
--- a/src/pacman/ini.c
+++ b/src/pacman/ini.c
@@ -155,8 +155,12 @@ static int _parse_ini(const char *file, ini_parser_fn cb, 
void *data,
                                        for(gindex = 0; gindex < 
globbuf.gl_pathc; gindex++) {
                                                pm_printf(ALPM_LOG_DEBUG, 
"config file %s, line %d: including %s\n",
                                                                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);
+                                               if(ret) {
+                                                       globfree(&globbuf);
+                                                       goto cleanup;
+                                               }
                                        }
                                        break;
                        }
-- 
1.8.3.3


Reply via email to