summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-05-08 11:27:58 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-05-08 11:27:58 +0300
commit42d0c3bd685ddbc093c3e9c8449c4cb015923f25 (patch)
tree98cee8755119049cd7a6855bc9acc8dfd4b492c9
parent8a024c20e79c76bcf02f6af3f6348cc25e62b646 (diff)
downloadrpm-42d0c3bd685ddbc093c3e9c8449c4cb015923f25.tar.gz
rpm-42d0c3bd685ddbc093c3e9c8449c4cb015923f25.tar.bz2
rpm-42d0c3bd685ddbc093c3e9c8449c4cb015923f25.zip
Only append trailing slash to ts rootdir if rootdir != "/"
-rw-r--r--lib/rpmts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 225cdcfae..26ccca829 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -967,7 +967,9 @@ void rpmtsSetRootDir(rpmts ts, const char * rootDir)
/* Ensure clean path with a trailing slash */
ts->rootDir = rpmGetPath(rootDir, NULL);
- rstrcat(&ts->rootDir, "/");
+ if (strcmp(ts->rootDir, "/") != 0) {
+ rstrcat(&ts->rootDir, "/");
+ }
}
}