summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2014-11-16 17:41:00 -0500
committerDave Reisner <dreisner@archlinux.org>2014-11-16 17:42:23 -0500
commit1f4a917495864544862f28b080a5b9fe6dd8865b (patch)
treebd18f6261360f4eab5110a52d79ec5ed5242bc54 /conf.c
parente54969e6ad8f6fe23c2703ef100e9dbeb050b1fe (diff)
downloadexpac-1f4a917495864544862f28b080a5b9fe6dd8865b.tar.xz
handle RootDir and DBPath from pacman config
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/conf.c b/conf.c
index 5aedc6e..c4927c5 100644
--- a/conf.c
+++ b/conf.c
@@ -156,6 +156,14 @@ static int parse_one_file(config_t *config, const char *filename, char **section
k = parse_include(config, val, section);
if (k < 0)
return k;
+ } else if (strcmp(line, "DBPath") == 0) {
+ config->dbpath = strdup(val);
+ if (config->dbpath == NULL)
+ return -ENOMEM;
+ } else if (strcmp(line, "RootDir") == 0) {
+ config->dbroot = strdup(val);
+ if (config->dbpath == NULL)
+ return -ENOMEM;
}
}
}
@@ -170,6 +178,9 @@ void config_reset(config_t *config) {
for (int i = 0; i < config->size; ++i)
free(config->repos[i]);
+ free(config->dbroot);
+ free(config->dbpath);
+
free(config->repos);
}