llist fixes
authorChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 07:25:33 +0000 (09:25 +0200)
committerChristian Thaeter <ct@pipapo.org>
Mon, 8 Oct 2007 07:25:33 +0000 (09:25 +0200)
llist.h

diff --git a/llist.h b/llist.h
index 4480e50..7b03b67 100644 (file)
--- a/llist.h
+++ b/llist.h
@@ -318,10 +318,9 @@ LLIST_FUNC (LList llist_insertlist_next (LList self, LList next),
             if (!llist_is_empty (next))
               {
                 self->next->prev = next->prev;
-                self->next = next->next;
-
-                next->next->prev = self; 
                 next->prev->next = self->next;
+                self->next = next->next;
+                next->next->prev = self;
 
                 next->prev = next->next = next;
               }
@@ -339,10 +338,9 @@ LLIST_FUNC (LList llist_insertlist_prev (LList self, LList prev),
             if (!llist_is_empty (prev))
               {
                 self->prev->next = prev->next;
-                self->prev = prev->prev;
-
-                prev->prev->next = self; 
                 prev->next->prev = self->prev;
+                self->prev = prev->prev;
+                prev->prev->next = self;
 
                 prev->prev = prev->next = prev;
               }