Commit 9587f3d1 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Always merge second list into first list as documented

parent e5b7c874
......@@ -397,9 +397,7 @@ list_append(void* data, void* userdata)
girara_list_t*
girara_list_merge(girara_list_t* list, girara_list_t* other)
{
if (list == NULL) {
return other;
}
g_return_val_if_fail(list != NULL, NULL);
if (other == NULL) {
return list;
}
......
......@@ -106,7 +106,7 @@ START_TEST(test_datastructures_list_merge) {
fail_unless((girara_list_merge(NULL, NULL) == NULL), NULL);
fail_unless((girara_list_merge(list1, NULL) == list1), NULL);
fail_unless((girara_list_merge(NULL, list2) == list2), NULL);
fail_unless((girara_list_merge(NULL, list2) == NULL), NULL);
girara_list_append(list1, (void*)0);
girara_list_append(list2, (void*)1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment