From bbfe57b95ad56f5c627e989b3d494da0bc951309 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Sat, 29 Oct 2005 07:18:40 +0000 Subject: [PATCH] fixed parseconfig usage --- src/pacman/conf.c | 6 +++--- src/pacman/conf.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pacman/conf.c b/src/pacman/conf.c index 72031a5f..fe3d8ad7 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -71,7 +71,7 @@ int config_free(config_t *config) return(0); } -int parseconfig(config_t *config) +int parseconfig(char *file, config_t *config) { FILE *fp = NULL; char line[PATH_MAX+1]; @@ -85,7 +85,7 @@ int parseconfig(config_t *config) return(-1); } - fp = fopen(config->configfile, "r"); + fp = fopen(file, "r"); if(fp == NULL) { return(0); } @@ -169,7 +169,7 @@ int parseconfig(config_t *config) char conf[PATH_MAX]; strncpy(conf, ptr, PATH_MAX); vprint("config: including %s\n", conf); - parseconfig(conf); + parseconfig(conf, config); } else if(!strcmp(section, "options")) { if(!strcmp(key, "NOUPGRADE")) { char *p = ptr; diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 2af5c430..7dd3ed4e 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -62,9 +62,10 @@ typedef struct __config_t { } config_t; #define FREECONF(p) do { if(p) { config_free(p); p = NULL; } } while(0) + config_t *config_new(); int config_free(config_t *config); -int parseconfig(config_t *config); +int parseconfig(char *file, config_t *config); #endif /* _PM_CONF_H */