commit | bb215e4a1fece603cdede556c1107135b31312a0 | [log] [tgz] |
---|---|---|
author | Rob Landley <rob@landley.net> | Mon Sep 09 05:26:52 2013 -0500 |
committer | Rob Landley <rob@landley.net> | Mon Sep 09 05:26:52 2013 -0500 |
tree | 61c4e038856cd84a3693df6a56a529202ec3f1f0 | |
parent | 5f57bccc41c8893914121b00e16a96dd16282486 [diff] [blame] |
Adjust patch to use dlist_pop()
diff --git a/lib/llist.c b/lib/llist.c index 596da40..71a187d 100644 --- a/lib/llist.c +++ b/lib/llist.c
@@ -37,8 +37,11 @@ { struct double_list **pdlist = (struct double_list **)list, *dlist = *pdlist; - dlist->next->prev = dlist->prev; - dlist->prev->next = *pdlist = dlist->next; + if (dlist->next == dlist) *pdlist = 0; + else { + dlist->next->prev = dlist->prev; + dlist->prev->next = *pdlist = dlist->next; + } return dlist; }