# HG changeset patch # User Jeffrey Connelly # Date 1187567028 0 # Node ID 9245404fe70c114ad6ed94400fd7d8d9f04494cb # Parent b66c5991c0110a80de2b75471cfbdeeff41cc343 In msim_msg_get(), start at the given node instead of using g_list_first() to back track and find the first node (since GList's are doubly-linked, it can do this). This means that msim_msg_get_*() functions now return values beginning from the MsimMessage * that was passed to the function, instead of at the very beginning, so you can pass an MsimMessage pointer in the middle of an MsimMessage (which is really just a GList) and it will search starting from where you gave it. diff -r b66c5991c011 -r 9245404fe70c libpurple/protocols/myspace/message.c --- a/libpurple/protocols/myspace/message.c Sun Aug 19 21:43:12 2007 +0000 +++ b/libpurple/protocols/myspace/message.c Sun Aug 19 23:43:48 2007 +0000 @@ -1003,21 +1003,21 @@ static GList * msim_msg_get_node(MsimMessage *msg, const gchar *name) { - GList *i; + GList *node; if (!name) { return NULL; } /* Linear search for the given name. O(n) but n is small. */ - for (i = g_list_first(msg); i != NULL; i = g_list_next(i)) { + for (node = msg; node != NULL; node = g_list_next(node)) { MsimMessageElement *elem; - elem = i->data; + elem = node->data; g_return_val_if_fail(elem != NULL, NULL); if (strcmp(elem->name, name) == 0) { - return i; + return node; } } return NULL;