[Swfdec] 2 commits - libswfdec/swfdec_xml.c libswfdec/swfdec_xml_node.c

Pekka Lampila medar at kemper.freedesktop.org
Fri Nov 2 03:31:44 PDT 2007


 libswfdec/swfdec_xml.c      |   10 ++++++----
 libswfdec/swfdec_xml_node.c |    7 ++++---
 2 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 8890bee87d10d7ee5f6f42e7b594644dc0484ab3
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Fri Nov 2 12:31:13 2007 +0200

    Fix couple of errors I just made, they broke XML support

diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c
index 0613e41..5c52126 100644
--- a/libswfdec/swfdec_xml.c
+++ b/libswfdec/swfdec_xml.c
@@ -561,8 +561,9 @@ swfdec_xml_parse_tag (SwfdecXml *xml, SwfdecXmlNode **node, const char *p)
   // create the new element
   if (!close) {
     child = swfdec_xml_node_new_no_properties (
-	SWFDEC_AS_OBJECT (*node)->context, SWFDEC_XML_NODE_ELEMENT, name);
-    g_free (name);
+	SWFDEC_AS_OBJECT (*node)->context, SWFDEC_XML_NODE_ELEMENT,
+	swfdec_as_context_give_string (SWFDEC_AS_OBJECT (*node)->context,
+	  name));
     if (child == NULL)
       return strchr (p, '\0');
   }
diff --git a/libswfdec/swfdec_xml_node.c b/libswfdec/swfdec_xml_node.c
index 1acad6a..a528896 100644
--- a/libswfdec/swfdec_xml_node.c
+++ b/libswfdec/swfdec_xml_node.c
@@ -976,8 +976,10 @@ swfdec_xml_node_init_values (SwfdecXmlNode *node, int type, const char* value)
 
   node->childNodes = SWFDEC_AS_ARRAY (swfdec_as_array_new (object->context));
 
-  if (node->children == NULL || node->attributes == NULL || node->childNodes)
+  if (node->children == NULL || node->attributes == NULL ||
+      node->childNodes == NULL) {
     node->valid = FALSE;
+  }
 }
 
 static void
commit dd072fab855300d58254e88a5cdf8ae83d645abb
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Fri Nov 2 12:17:33 2007 +0200

    Make swfdec_xml_node_new take GC'd string as an argument

diff --git a/libswfdec/swfdec_xml.c b/libswfdec/swfdec_xml.c
index b64b16e..0613e41 100644
--- a/libswfdec/swfdec_xml.c
+++ b/libswfdec/swfdec_xml.c
@@ -643,8 +643,9 @@ swfdec_xml_parse_text (SwfdecXml *xml, SwfdecXmlNode *node,
     unescaped = swfdec_xml_unescape (SWFDEC_AS_OBJECT (xml)->context, text);
     g_free (text);
     child = swfdec_xml_node_new_no_properties (
-	SWFDEC_AS_OBJECT (node)->context, SWFDEC_XML_NODE_TEXT, unescaped);
-    g_free (unescaped);
+	SWFDEC_AS_OBJECT (node)->context, SWFDEC_XML_NODE_TEXT,
+	swfdec_as_context_give_string (SWFDEC_AS_OBJECT (xml)->context,
+	  unescaped));
     if (child == NULL)
       return strchr (p, '\0');
     swfdec_xml_node_appendChild (node, child);
diff --git a/libswfdec/swfdec_xml_node.c b/libswfdec/swfdec_xml_node.c
index 71b7a5c..1acad6a 100644
--- a/libswfdec/swfdec_xml_node.c
+++ b/libswfdec/swfdec_xml_node.c
@@ -1052,8 +1052,7 @@ swfdec_xml_node_new_no_properties (SwfdecAsContext *context,
 	SWFDEC_AS_VALUE_GET_OBJECT (&val));
   }
 
-  swfdec_xml_node_init_values (node, type,
-      swfdec_as_context_get_string (SWFDEC_AS_OBJECT (node)->context, value));
+  swfdec_xml_node_init_values (node, type, value);
 
   return node;
 }


More information about the Swfdec mailing list