From 45d55698d8b82999ec1538eba2b5f94872858e68 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 11 Nov 2011 00:05:56 +0100 Subject: [PATCH] libxbps: strip redundant dir separators returned by xbps_pkg_index_plist(). --- lib/util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/util.c b/lib/util.c index f58a764f..c3d39f27 100644 --- a/lib/util.c +++ b/lib/util.c @@ -211,15 +211,15 @@ get_pkg_index_remote_plist(const char *uri) if (uri_fixed == NULL) return NULL; - repodir = xbps_xasprintf("%s/%s/%s/%s", - prop_string_cstring_nocopy(xhp->rootdir), - XBPS_META_PATH, uri_fixed, XBPS_PKGINDEX); - if (repodir == NULL) { - free(uri_fixed); - return NULL; + if (prop_string_equals_cstring(xhp->rootdir, "/")) { + repodir = xbps_xasprintf("%s/%s/%s", + XBPS_META_PATH, uri_fixed, XBPS_PKGINDEX); + } else { + repodir = xbps_xasprintf("%s/%s/%s", + prop_string_cstring_nocopy(xhp->rootdir), + XBPS_META_PATH, uri_fixed, XBPS_PKGINDEX); } free(uri_fixed); - return repodir; }