[PATCH wayland 1/2] wayland-util: wl_list_insert_list() should accept empty lists

Jonas Ådahl jadahl at gmail.com
Tue Jun 12 14:57:32 PDT 2012


Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
---
 src/wayland-util.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/wayland-util.c b/src/wayland-util.c
index eac7801..107b6db 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;
-- 
1.7.9.5



More information about the wayland-devel mailing list