From cb65f08d2fc13005bba953c42f815d9dda23111f Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 20 Nov 2006 22:15:26 +0000 Subject: libalpm appends the trailing / to the config root, no need to do it here --- src/pacman/pacman.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/pacman/pacman.c') 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); -- cgit v1.2.3