mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-06 07:15:47 -04:00
wayland-util: wl_list_insert_list() should accept empty lists
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
dd8891be36
commit
f36f32a0e0
1 changed files with 3 additions and 0 deletions
|
|
@ -79,6 +79,9 @@ wl_list_empty(struct wl_list *list)
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
wl_list_insert_list(struct wl_list *list, struct wl_list *other)
|
wl_list_insert_list(struct wl_list *list, struct wl_list *other)
|
||||||
{
|
{
|
||||||
|
if (wl_list_empty(other))
|
||||||
|
return;
|
||||||
|
|
||||||
other->next->prev = list;
|
other->next->prev = list;
|
||||||
other->prev->next = list->next;
|
other->prev->next = list->next;
|
||||||
list->next->prev = other->prev;
|
list->next->prev = other->prev;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue