From: <fac...@us...> - 2006-08-24 17:33:28
|
Revision: 17017 Author: faceprint Date: 2006-08-24 10:33:24 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=17017&view=rev Log Message: ----------- fix xmlnode_from_str for libxml2 Modified Paths: -------------- trunk/libgaim/xmlnode.c Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-08-24 17:01:05 UTC (rev 17016) +++ trunk/libgaim/xmlnode.c 2006-08-24 17:33:24 UTC (rev 17017) @@ -570,7 +570,7 @@ xpd = g_new0(struct _xmlnode_parser_data, 1); #ifdef HAVE_LIBXML - if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, size) < 0) { + if (xmlSAXUserParseMemory(&xmlnode_parser_libxml, xpd, str, real_size) < 0) { while(xpd->current && xpd->current->parent) xpd->current = xpd->current->parent; if(xpd->current) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fac...@us...> - 2006-12-07 04:32:31
|
Revision: 17908 http://svn.sourceforge.net/gaim/?rev=17908&view=rev Author: faceprint Date: 2006-12-06 20:25:29 -0800 (Wed, 06 Dec 2006) Log Message: ----------- maybe fix 1608655 Modified Paths: -------------- trunk/libgaim/xmlnode.c Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-12-07 04:04:11 UTC (rev 17907) +++ trunk/libgaim/xmlnode.c 2006-12-07 04:25:29 UTC (rev 17908) @@ -294,9 +294,12 @@ g_string_append_printf(text, "<%s", node_name); if (node->namespace) { - char *namespace = g_markup_escape_text(node->namespace, -1); - g_string_append_printf(text, " xmlns='%s'", namespace); - g_free(namespace); + if(!node->parent || !node->parent->namespace || strcmp(node->namespace, node->parent->namespace)) + { + char *namespace = g_markup_escape_text(node->namespace, -1); + g_string_append_printf(text, " xmlns='%s'", namespace); + g_free(namespace); + } } for(c = node->child; c; c = c->next) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-12-15 07:28:23
|
Revision: 18005 http://svn.sourceforge.net/gaim/?rev=18005&view=rev Author: thekingant Date: 2006-12-14 23:28:23 -0800 (Thu, 14 Dec 2006) Log Message: ----------- Bug fix from Graham Booker. Fix an invalid pointer that resulted from removing the last attribute of an xmlnode. Modified Paths: -------------- trunk/libgaim/xmlnode.c Modified: trunk/libgaim/xmlnode.c =================================================================== --- trunk/libgaim/xmlnode.c 2006-12-15 07:00:32 UTC (rev 18004) +++ trunk/libgaim/xmlnode.c 2006-12-15 07:28:23 UTC (rev 18005) @@ -127,14 +127,16 @@ for(attr_node = node->child; attr_node; attr_node = attr_node->next) { if(attr_node->type == XMLNODE_TYPE_ATTRIB && - !strcmp(attr_node->name, attr)) { + !strcmp(attr_node->name, attr)) + { if(node->child == attr_node) { node->child = attr_node->next; - } else if (node->lastchild == attr_node) { - node->lastchild = sibling; } else { sibling->next = attr_node->next; } + if (node->lastchild == attr_node) { + node->lastchild = sibling; + } xmlnode_free(attr_node); return; } @@ -155,14 +157,16 @@ { if(attr_node->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr_node->name, attr) && - !strcmp(attr_node->xmlns, xmlns)) { + !strcmp(attr_node->xmlns, xmlns)) + { if(node->child == attr_node) { node->child = attr_node->next; - } else if (node->lastchild == attr_node) { - node->lastchild = sibling; } else { sibling->next = attr_node->next; } + if (node->lastchild == attr_node) { + node->lastchild = sibling; + } xmlnode_free(attr_node); return; } @@ -204,7 +208,7 @@ attrib_node->data = g_strdup(value); attrib_node->xmlns = g_strdup(xmlns); - xmlnode_insert_child(node, attrib_node); + xmlnode_insert_child(node, attrib_node); } const char * @@ -231,13 +235,13 @@ g_return_val_if_fail(node != NULL, NULL); for(x = node->child; x; x = x->next) { - if(x->type == XMLNODE_TYPE_ATTRIB && + if(x->type == XMLNODE_TYPE_ATTRIB && !strcmp(attr, x->name) && !strcmp(x->xmlns, xmlns)) { return x->data; } } - return NULL; + return NULL; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |