summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-10-29 07:18:40 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-10-29 07:18:40 +0000
commitbbfe57b95ad56f5c627e989b3d494da0bc951309 (patch)
tree9d8b54df3dd66277bc31b3d5667879e5c6d45577 /src
parent617263a6056d6305a49ff5d6a95468683f006647 (diff)
fixed parseconfig usage
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c6
-rw-r--r--src/pacman/conf.h3
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 */