summaryrefslogtreecommitdiff
path: root/rpmdb
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-05-16 16:18:05 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-05-16 16:18:05 +0300
commit2c080c11877fa083b6439b207368e05bb24e5b59 (patch)
tree6b1562c0cbc5a790e7147bded599680a36ae6c40 /rpmdb
parent7e796f6f52b175097914a0b7bfd5d104b0d60ade (diff)
downloadrpm-2c080c11877fa083b6439b207368e05bb24e5b59.tar.gz
rpm-2c080c11877fa083b6439b207368e05bb24e5b59.tar.bz2
rpm-2c080c11877fa083b6439b207368e05bb24e5b59.zip
Make rebuilddb work with the --root option.
Patch from OpenSuSE.
Diffstat (limited to 'rpmdb')
-rw-r--r--rpmdb/rpmdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c
index c15253e21..e88c92eef 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"),