mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-16 22:35:09 -05:00
Ensure we don't have double slashes when creating frontend paths
Because libalpm always returns a root path with a trailing slash, when we use it to create our unspecified paths we get double slashes in the result. Use the fix suggested by Jürgen Hötzel to remedy this. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
242e9e90f4
commit
18452a6c51
@ -262,11 +262,13 @@ static void setlibpaths(void)
|
|||||||
cleanup(ret);
|
cleanup(ret);
|
||||||
}
|
}
|
||||||
if(!config->dbpath) {
|
if(!config->dbpath) {
|
||||||
snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), DBPATH);
|
/* omit leading slash from our static DBPATH, root handles it */
|
||||||
|
snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), DBPATH + 1);
|
||||||
config->dbpath = strdup(path);
|
config->dbpath = strdup(path);
|
||||||
}
|
}
|
||||||
if(!config->logfile) {
|
if(!config->logfile) {
|
||||||
snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), LOGFILE);
|
/* omit leading slash from our static LOGFILE path, root handles it */
|
||||||
|
snprintf(path, PATH_MAX, "%s%s", alpm_option_get_root(), LOGFILE + 1);
|
||||||
config->logfile = strdup(path);
|
config->logfile = strdup(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user