From f36f32a0e05b4af290862b9d0ec685f6d095786f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 12 Jun 2012 23:57:32 +0200 Subject: [PATCH] wayland-util: wl_list_insert_list() should accept empty lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Ã…dahl --- src/wayland-util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wayland-util.c b/src/wayland-util.c index eac7801c..107b6dbb 100644 --- a/src/wayland-util.c +++ b/src/wayland-util.c @@ -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;