wayland-util: wl_list_insert_list() should accept empty lists
authorJonas Ådahl <jadahl@gmail.com>
Tue, 12 Jun 2012 21:57:32 +0000 (23:57 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 13 Jun 2012 00:18:38 +0000 (20:18 -0400)
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
src/wayland-util.c

index eac7801..107b6db 100644 (file)
@@ -79,6 +79,9 @@ wl_list_empty(struct wl_list *list)
 WL_EXPORT void
 wl_list_insert_list(struct wl_list *list, struct wl_list *other)
 {
+       if (wl_list_empty(other))
+               return;
+
        other->next->prev = list;
        other->prev->next = list->next;
        list->next->prev = other->prev;