Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore


Modified Files:
        ecore_list.c 


Log Message:
When doing remove_last on a dlist, use the ->previous property well!

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore/ecore_list.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ecore_list.c        10 Jan 2007 21:56:11 -0000      1.28
+++ ecore_list.c        13 Jan 2007 17:49:15 -0000      1.29
@@ -1431,10 +1431,28 @@
 ecore_dlist_remove_last(Ecore_DList *list)
 {
    void *ret;
+   Ecore_List_Node *node;
 
    CHECK_PARAM_POINTER_RETURN("list", list, NULL);
 
-   ret = _ecore_list_remove_last(list);
+   if (ecore_list_is_empty(list))
+     return NULL;
+
+   node = list->last;
+   list->last = ECORE_LIST_NODE(ECORE_DLIST_NODE(node)->previous);
+   if (list->last)
+     list->last->next = NULL;
+   if (list->first == node)
+     list->first = NULL;
+   if (list->current == node)
+     list->current = NULL;
+
+   ret = node->data;
+   ecore_list_node_destroy(node, NULL);
+
+   list->nodes--;
+   if (list->index >= list->nodes)
+     list->index--;
 
    return ret;
 }



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to