|
From: <cli...@li...> - 2007-05-22 16:44:19
|
Revision: 63
http://cligg.svn.sourceforge.net/cligg/?rev=63&view=rev
Author: sithhell
Date: 2007-05-22 09:44:16 -0700 (Tue, 22 May 2007)
Log Message:
-----------
another fix for the list
Modified Paths:
--------------
src/lib/cligg_list.c
Modified: src/lib/cligg_list.c
===================================================================
--- src/lib/cligg_list.c 2007-05-22 13:03:24 UTC (rev 62)
+++ src/lib/cligg_list.c 2007-05-22 16:44:16 UTC (rev 63)
@@ -130,10 +130,10 @@
if(list->first == NULL)
list->first = new_element;
- if(list->last != NULL)
+ if(list->last != NULL) {
list->last->next = new_element;
+ }
list->last = new_element;
- new_element->next = NULL;
list->size++;
return TRUE;
@@ -167,7 +167,6 @@
}
list->first = new_element;
- new_element->prev = NULL;
list->size++;
@@ -203,7 +202,7 @@
if(list == NULL) return FALSE;
tmp = list->current;
- if((tmp = list->first))
+ if((tmp == list->first))
tmp = NULL;
list->current = list->first;
@@ -219,7 +218,7 @@
if(list == NULL) return FALSE;
tmp = list->current;
- if((tmp = list->last))
+ if((tmp == list->last))
tmp = NULL;
list->current = list->last;
@@ -277,12 +276,18 @@
if(list->current == NULL)
return FALSE;
- if(list->current->prev != NULL)
+ if(list->current->prev != NULL) {
list->current->prev->next = list->current->next;
+ }
else
list->first = list->current->next;
+
if(list->current->next != NULL)
list->current->next->prev = list->current->prev;
+ else {
+ list->first = NULL;
+ list->last = NULL;
+ }
list->current = NULL;
if(list->free_func)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|