diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-11-20 22:15:26 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-11-20 22:15:26 +0000 |
commit | cb65f08d2fc13005bba953c42f815d9dda23111f (patch) | |
tree | 1a01602274d0af92bff1729489096bb1aefc2a7a | |
parent | aa1c0ba9f8787fc3b1a1190103e394b0c1c95922 (diff) | |
download | pacman-cb65f08d2fc13005bba953c42f815d9dda23111f.tar.xz |
libalpm appends the trailing / to the config root, no need to do it here
-rw-r--r-- | src/pacman/pacman.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index c138c2c4..05738c33 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -486,27 +486,12 @@ int main(int argc, char *argv[]) config->root = PM_ROOT; } - char *initroot = NULL; - /* add a trailing '/' if there isn't one */ - if(config->root[strlen(config->root)-1] != '/') { - char *ptr; - MALLOC(ptr, strlen(config->root)+2); - strcpy(ptr, config->root); - strcat(ptr, "/"); - initroot = ptr; - } else { - initroot = strdup(config->root); - } - /* initialize pm library */ - if(alpm_initialize(initroot) == -1) { + if(alpm_initialize(config->root) == -1) { ERR(NL, _("failed to initilize alpm library (%s)\n"), alpm_strerror(pm_errno)); cleanup(1); } - FREE(initroot); - config->root = alpm_option_get_root(); - /* Setup logging as soon as possible, to print out maximum debugging info */ alpm_option_set_logmask(config->debug); alpm_option_set_logcb(cb_log); |