Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewd

Dir     : e17/libs/ewd/src


Modified Files:
        ewd_list.c 


Log Message:
Minor list update to prevent some possible looping when traversing and
altering content simultaneously.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewd/src/ewd_list.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ewd_list.c  25 Sep 2003 00:24:01 -0000      1.19
+++ ewd_list.c  17 Oct 2003 18:39:31 -0000      1.20
@@ -214,7 +214,7 @@
        list->last = end;
 
        if (list->first == NULL) {
-               list->first = list->current = end;
+               list->first = end;
                list->index = 1;
        }
 
@@ -257,10 +257,6 @@
 
        list->first = start;
 
-       /* If there's no current item selected, select the first one */
-       if (!list->current)
-               list->current = list->first;
-
        /* If no last node, then the first node is the last node */
        if (list->last == NULL)
                list->last = list->first;
@@ -513,17 +509,20 @@
                return FALSE;
 
        old = list->last;
+       if (list->current == old)
+               list->current = NULL;
+
+       if (list->first == old)
+               list->first = NULL;
        for (prev = list->first; prev && prev->next != old; prev = prev->next);
        if (prev) {
                prev->next = NULL;
                list->last = prev;
                if (list->current == old) {
-                       list->current = prev;
-                       list->index--;
+                       list->current = NULL;
                }
        }
-       else
-               list->first = list->current = list->last = NULL;
+
 
        EWD_WRITE_LOCK(old);
        if (old) {




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to