summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-11-16 18:01:12 -0500
committerDave Reisner <dreisner@archlinux.org>2014-11-16 18:04:08 -0500
commit9bc85c516bed428b1bd8520f2c371d016af67a68 (patch)
treea8506729b319624f80bc16a85a1133f46187bb4b /conf.c
parent3857cd02e80e371747005f358701a463b5365b04 (diff)
downloadexpac-9bc85c516bed428b1bd8520f2c371d016af67a68.tar.xz
move flag parsing out of expac_new
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c9
1 files changed, 5 insertions, 4 deletions
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) {