[pacman-dev] [PATCH 4/9] ini.c: remove final callback call
Andrew Gregory
andrew.gregory.8 at gmail.com
Sat Apr 26 19:56:57 EDT 2014
Storing repo information removes the need for the final callback. This
allows the call signature to be re-purposed for indicating read errors.
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
src/pacman/conf.c | 4 +---
src/pacman/ini.c | 4 ----
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 8b2078b..6eb197a 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -871,9 +871,7 @@ static int _parse_directive(const char *file, int linenum, const char *name,
if(!key && !value) {
section->name = name;
pm_printf(ALPM_LOG_DEBUG, "config: new section '%s'\n", name);
- if(!name) {
- /* end of file, do nothing */
- } else if(strcmp(name, "options") == 0) {
+ if(strcmp(name, "options") == 0) {
section->repo = NULL;
} else {
section->repo = calloc(sizeof(config_repo_t), 1);
diff --git a/src/pacman/ini.c b/src/pacman/ini.c
index 2a3ef0e..fdc7642 100644
--- a/src/pacman/ini.c
+++ b/src/pacman/ini.c
@@ -172,10 +172,6 @@ static int _parse_ini(const char *file, ini_parser_fn cb, void *data,
}
}
- if(depth == 0) {
- ret = cb(NULL, 0, NULL, NULL, NULL, data);
- }
-
cleanup:
if(fp) {
fclose(fp);
--
1.9.2
More information about the pacman-dev
mailing list