changeset 8167:b55b70aef314

[gaim-migrate @ 8880] make xmlnode_copy work, and let everyone know about it committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 25 Jan 2004 19:12:58 +0000
parents ac7bf273bd66
children 3d3c2dd28068
files src/xmlnode.c src/xmlnode.h
diffstat 2 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmlnode.c	Sat Jan 24 22:40:59 2004 +0000
+++ b/src/xmlnode.c	Sun Jan 25 19:12:58 2004 +0000
@@ -392,8 +392,12 @@
 
 	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) {
--- a/src/xmlnode.h	Sat Jan 24 22:40:59 2004 +0000
+++ b/src/xmlnode.h	Sun Jan 25 19:12:58 2004 +0000
@@ -54,6 +54,7 @@
 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);