From 9bc85c516bed428b1bd8520f2c371d016af67a68 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 16 Nov 2014 18:01:12 -0500 Subject: move flag parsing out of expac_new --- conf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index c4927c5..a0248c8 100644 --- a/conf.c +++ b/conf.c @@ -71,7 +71,8 @@ static int config_add_repo(config_t *config, char *reponame) { static int parse_one_file(config_t *config, const char *filename, char **section); static int parse_include(config_t *config, const char *include, char **section) { - _cleanup_(globfreep) glob_t globbuf = {}; + glob_t globbuf; + int r = 0; if (glob(include, GLOB_NOCHECK, NULL, &globbuf) != 0) { fprintf(stderr, "warning: globbing failed on '%s': out of memory\n", @@ -80,13 +81,13 @@ static int parse_include(config_t *config, const char *include, char **section) } for (size_t i = 0; i < globbuf.gl_pathc; ++i) { - int r; r = parse_one_file(config, globbuf.gl_pathv[i], section); if (r < 0) - return r; + break; } - return 0; + globfree(&globbuf); + return r; } static char *split_keyval(char *line, const char *sep) { -- cgit v1.2.3-54-g00ecf