Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-16 13:03:33 -0500
committerDan McGee <dan@archlinux.org>2011-06-20 00:10:11 -0500
commit0f26e3aa5b91ffc0a5bef9a0f0bb9d40ec198407 (patch)
tree89362d83560d4eb8b61f9227ec842801819d92ea /lib/libalpm/package.c
parentdeb5601d8d19760fd569abe3508786d97cc1ceba (diff)
Correctly duplicate delta objects
We were using copy_data before; this works for the struct itself but not the strings contained within. Fix it up by duplicating all the data as we do with our other structures. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index ff011982..0b0e9741 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -466,7 +466,9 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg)
newpkg->optdepends = alpm_list_strdup(pkg->optdepends);
newpkg->conflicts = alpm_list_strdup(pkg->conflicts);
newpkg->provides = alpm_list_strdup(pkg->provides);
- newpkg->deltas = alpm_list_copy_data(pkg->deltas, sizeof(pmdelta_t));
+ for(i = pkg->deltas; i; i = alpm_list_next(i)) {
+ newpkg->deltas = alpm_list_add(newpkg->deltas, _alpm_delta_dup(i->data));
+ }
/* internal */
newpkg->infolevel = pkg->infolevel;