[Swfdec] libswfdec/swfdec_as_object.c

Benjamin Otte company at kemper.freedesktop.org
Thu Oct 25 07:22:32 PDT 2007


 libswfdec/swfdec_as_object.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 429b50907703001fb58cf9840751844b0b8ea839
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Oct 25 16:22:12 2007 +0200

    rework swfdec_as_object_decode()
    
    It used to unescape before looking for = or & signs
    Also, it had 2 memleaks
    I should probably add a test for this...

diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c
index 6cd0661..39a8da5 100644
--- a/libswfdec/swfdec_as_object.c
+++ b/libswfdec/swfdec_as_object.c
@@ -1518,14 +1518,11 @@ swfdec_as_object_toString (SwfdecAsContext *cx, SwfdecAsObject *object,
 void
 swfdec_as_object_decode (SwfdecAsObject *object, const char *str)
 {
+  SwfdecAsContext *cx = object->context;
   SwfdecAsValue val;
   char **varlist, *p;
   guint i;
 
-  str = swfdec_as_string_unescape (object->context, str);
-  if (str == NULL)
-    return;
-
   varlist = g_strsplit (str, "&", -1);
 
   for (i = 0; varlist[i] != NULL; i++) {
@@ -1538,13 +1535,16 @@ swfdec_as_object_decode (SwfdecAsObject *object, const char *str)
 
     if (p != NULL) {
       SWFDEC_AS_VALUE_SET_STRING (&val,
-	  swfdec_as_context_get_string (object->context, p));
+	  swfdec_as_context_give_string (object->context, 
+	    swfdec_as_string_unescape (cx, p)));
     } else {
       SWFDEC_AS_VALUE_SET_STRING (&val, SWFDEC_AS_STR_EMPTY);
     }
     swfdec_as_object_set_variable (object,
-	swfdec_as_context_get_string (object->context, varlist[i]), &val);
+	swfdec_as_context_give_string (object->context, 
+	  swfdec_as_string_unescape (cx, varlist[i])), &val);
   }
+  g_strfreev (varlist);
 }
 
 void


More information about the Swfdec mailing list