diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/types.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/types.c b/src/types.c index 3e720b8..dbc7458 100644 --- a/src/types.c +++ b/src/types.c @@ -330,9 +330,12 @@ distinct_sum_items(recipe * dst, recipe * src) void merge_items(recipe * dst, recipe * src) { - /* Join all items in src's subrecipes to dst */ - join_subrecipe_items(dst, src); - /* Copy src items as well to dst */ - copy_items(dst, src); - distinct_sum_items(dst, dst); + recipe * _r = new_recipe(); + /* Join all items in src's subrecipes to tmp */ + join_subrecipe_items(_r, src); + /* Copy src items as well to tmp */ + copy_items(_r, src); + /* disticnt items to dst */ + distinct_sum_items(dst, _r); + free_recipe(_r); } |