From 9eb07a81fa359f323bfa540f8fbefa4c11e2260c Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 26 Apr 2014 12:21:21 -0400 Subject: ini.c: remove final callback call 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 --- src/pacman/conf.c | 4 +--- src/pacman/ini.c | 7 +------ 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 54f31461..fbf7bb3c 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -902,9 +902,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 2eb32302..7b35c243 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); @@ -199,8 +195,7 @@ cleanup: * otherwise * * @note The callback will be called at the beginning of each section with an - * empty key and value, for each key/value pair, and when parsing is complete - * with all arguments except @a data empty. + * empty key and value and for each key/value pair. * * @note The @a key and @a value passed to @ cb will be overwritten between * calls. The section name will remain valid until after @a cb is called to -- cgit v1.2.3-24-g4f1b