Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-14 22:53:42 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-14 22:53:42 +0000
commitad2c7463c9b3ccf35ed40d8fa4cc21309048bdbc (patch)
treebbe2b153c2d9b471b10a41c3179d80ccd7c8ac0a /lib/libalpm/db.c
parent80c7f0efcae9ea7d053d8ba58d2f9adbc75c5cd8 (diff)
put back treename in db->path
Diffstat (limited to 'lib/libalpm/db.c')
-rw-r--r--lib/libalpm/db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 01265917..ad50977c 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -48,14 +48,14 @@ pmdb_t *_alpm_db_new(char *root, char* dbpath, char *treename)
RET_ERR(PM_ERR_MEMORY, NULL);
}
- db->path = (char *)malloc(strlen(root)+strlen(dbpath)+1);
+ db->path = (char *)malloc(strlen(root)+strlen(dbpath)+strlen(treename)+2);
if(db->path == NULL) {
_alpm_log(PM_LOG_ERROR, "malloc failed: could not allocate %d bytes",
- strlen(root)+strlen(dbpath)+1);
+ strlen(root)+strlen(dbpath)+strlen(treename)+2);
FREE(db);
RET_ERR(PM_ERR_MEMORY, NULL);
}
- sprintf(db->path, "%s%s", root, dbpath);
+ sprintf(db->path, "%s%s/%s", root, dbpath, treename);
STRNCPY(db->treename, treename, DB_TREENAME_LEN);