summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-09-28 19:33:56 -0500
committerDan McGee <dan@archlinux.org>2008-10-12 21:27:52 -0500
commit18452a6c51827e91f37978397552c30cb92c26cd (patch)
treec4d8dbd14574039b2167d8cc3d4dd194668118b1
parent242e9e90f4190b9f770a0230e99d302f7ec53e70 (diff)
downloadpacman-18452a6c51827e91f37978397552c30cb92c26cd.tar.xz
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>
-rw-r--r--src/pacman/pacman.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 81f07dac..3a56a9d3 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -262,11 +262,13 @@ static void setlibpaths(void)
cleanup(ret);
}
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);
}
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);
}
}