g_list_remove_link bug



Hi!
I think there is a bug in glib-1.2:

In function

GList*
g_list_remove_link (GList *list,
                    GList *link)

link is removed from the list. If link and list are identical, then
list=list->next. This is good most of the time, but when list (and link)
is the last element of the list, this results in list=NULL. 

I would like to see it like this:


...
      if (link == list) 
        if (list->next)
          list = list->next;
        else 
          list = list->prev;
...

Greetings,
Roland Bock



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]