From 2c080c11877fa083b6439b207368e05bb24e5b59 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 16 May 2007 16:18:05 +0300 Subject: [PATCH] Make rebuilddb work with the --root option. Patch from OpenSuSE. --- rpmdb/rpmdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index c15253e..e88c92e 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -3773,7 +3773,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } dbpath = rootdbpath = rpmGetPath(prefix, tfn, NULL); if (!(prefix[0] == '/' && prefix[1] == '\0')) - dbpath += strlen(prefix); + dbpath += strlen(prefix) - 1; tfn = _free(tfn); /*@-nullpass@*/ @@ -3796,7 +3796,7 @@ int rpmdbRebuild(const char * prefix, rpmts ts, } newdbpath = newrootdbpath = rpmGetPath(prefix, tfn, NULL); if (!(prefix[0] == '/' && prefix[1] == '\0')) - newdbpath += strlen(prefix); + newdbpath += strlen(prefix) - 1; tfn = _free(tfn); rpmMessage(RPMMESS_DEBUG, _("rebuilding database %s into %s\n"), -- 2.7.4