index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/pacman/conf.c | 1 | ||||
-rw-r--r-- | src/pacman/conf.h | 2 | ||||
-rw-r--r-- | src/pacman/pacman.c | 4 |
diff --git a/src/pacman/conf.c b/src/pacman/conf.c index ef380580..a429690e 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -53,6 +53,7 @@ int config_free(config_t *config) return(-1); } + FREE(config->root); FREE(config->configfile); FREELIST(config->op_s_ignore); free(config); diff --git a/src/pacman/conf.h b/src/pacman/conf.h index 79f9c0ec..a4bac015 100644 --- a/src/pacman/conf.h +++ b/src/pacman/conf.h @@ -23,7 +23,7 @@ typedef struct __config_t { /* command line options */ - const char *root; + char *root; const char *dbpath; const char *cachedir; char *configfile; diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index d99ddc04..0f55ec43 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -356,10 +356,12 @@ static int parseargs(int argc, char *argv[]) config->flags |= PM_TRANS_FLAG_PRINTURIS; break; case 'r': + printf("setting root path=%s\n", optarg); if(realpath(optarg, root) == NULL) { perror(_("bad root path")); return(1); } + config->root = strdup(root); break; case 's': config->op_s_search = 1; @@ -488,7 +490,7 @@ int main(int argc, char *argv[]) #endif if(config->root == NULL) { - config->root = PM_ROOT; + config->root = strdup(PM_ROOT); } /* initialize pm library */ |