From: Nathan W. <fac...@us...> - 2004-01-25 19:14:35
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30773/src Modified Files: xmlnode.c xmlnode.h Log Message: make xmlnode_copy work, and let everyone know about it Index: xmlnode.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/xmlnode.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- xmlnode.c 17 Jan 2004 19:36:29 -0000 1.4 +++ xmlnode.c 25 Jan 2004 19:12:56 -0000 1.5 @@ -392,8 +392,12 @@ xmlnode *xmlnode_copy(xmlnode *src) ret = new_node(src->name, src->type); if(src->data) { - ret->data = g_memdup(src->data, src->data_sz); - ret->data_sz = src->data_sz; + if(src->data_sz) { + ret->data = g_memdup(src->data, src->data_sz); + ret->data_sz = src->data_sz; + } else { + ret->data = g_strdup(src->data); + } } for(child = src->child; child; child = child->next) { Index: xmlnode.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/xmlnode.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- xmlnode.h 17 Jan 2004 19:36:29 -0000 1.4 +++ xmlnode.h 25 Jan 2004 19:12:58 -0000 1.5 @@ -54,6 +54,7 @@ const char *xmlnode_get_attrib(xmlnode * void xmlnode_remove_attrib(xmlnode *node, const char *attr); char *xmlnode_to_str(xmlnode *node, int *len); xmlnode *xmlnode_from_str(const char *str, size_t size); +xmlnode *xmlnode_copy(xmlnode *src); void xmlnode_free(xmlnode *node); |