fragment: reparent a fragment-list when a duplicate is encountered (closes issue #34).

pull/36/head
William Pitcock 2012-08-09 17:14:56 -05:00
parent 58fa286972
commit 86845f7098
1 changed files with 7 additions and 2 deletions

View File

@ -86,8 +86,13 @@ pkg_fragment_copy(pkg_fragment_t *head, pkg_fragment_t *base)
{
pkg_fragment_t *frag;
if (pkg_fragment_exists(head, base))
return head;
if ((frag = pkg_fragment_lookup(head, base)) != NULL)
{
if (head == frag)
head = frag->next;
pkg_fragment_delete(frag);
}
frag = calloc(sizeof(pkg_fragment_t), 1);