[gupnp-av] Fix get_{create|search}_classes



commit 1b5186b1cfc995a8f0e04609c9a40883f96bcb82
Author: Jens Georg <mail jensge org>
Date:   Sun Aug 19 17:45:42 2012 +0200

    Fix get_{create|search}_classes
    
    We need to return the content of the first child (a TEXT node) and not
    the content of the node itself.
    
    Fixes:
        https://bugzilla.gnome.org/show_bug.cgi?id=676372

 libgupnp-av/gupnp-didl-lite-container.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/libgupnp-av/gupnp-didl-lite-container.c b/libgupnp-av/gupnp-didl-lite-container.c
index a3db0d5..6fa7a8b 100644
--- a/libgupnp-av/gupnp-didl-lite-container.c
+++ b/libgupnp-av/gupnp-didl-lite-container.c
@@ -255,9 +255,11 @@ gupnp_didl_lite_container_get_create_classes (GUPnPDIDLLiteContainer *container)
                 xmlNode *node;
 
                 node = (xmlNode *) l->data;
-                create_class = g_strdup ((const char *) node->content);
+                if (node->children != NULL) {
+                    create_class = g_strdup ((const char *) node->children->content);
 
-                ret = g_list_append (ret, create_class);
+                    ret = g_list_append (ret, create_class);
+                }
         }
 
         g_list_free (classes);
@@ -294,9 +296,11 @@ gupnp_didl_lite_container_get_search_classes (GUPnPDIDLLiteContainer *container)
                 xmlNode *node;
 
                 node = (xmlNode *) l->data;
-                search_class = g_strdup ((const char *) node->content);
+                if (node->children != NULL) {
+                    search_class = g_strdup ((const char *) node->children->content);
 
-                ret = g_list_append (ret, search_class);
+                    ret = g_list_append (ret, search_class);
+                }
         }
 
         g_list_free (classes);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]