1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

libalpm appends the trailing / to the config root, no need to do it here

This commit is contained in:
Aaron Griffin 2006-11-20 22:15:26 +00:00
parent aa1c0ba9f8
commit cb65f08d2f

View File

@ -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);