[grilo-plugins] tracker: escape strings on sparql updates



commit c2ad35ccc6a584ddc5d906ee764ccda0b0da2ea3
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date:   Wed Mar 30 11:36:25 2011 +0100

    tracker: escape strings on sparql updates
    
    Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>

 src/media/tracker/grl-tracker-utils.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-utils.c b/src/media/tracker/grl-tracker-utils.c
index 346e29f..e4a1205 100644
--- a/src/media/tracker/grl-tracker-utils.c
+++ b/src/media/tracker/grl-tracker-utils.c
@@ -349,11 +349,14 @@ gen_prop_insert_string (GString *gstr,
                         tracker_grl_sparql_t *assoc,
                         GrlData *data)
 {
+  gchar *tmp;
+
   switch (G_PARAM_SPEC (assoc->grl_key)->value_type) {
   case G_TYPE_STRING:
-    g_string_append_printf (gstr, "%s %s",
-                            assoc->sparql_key_attr,
-                            grl_data_get_string (data, assoc->grl_key));
+    tmp = g_strescape (grl_data_get_string (data, assoc->grl_key), NULL);
+    g_string_append_printf (gstr, "%s \"%s\"",
+                            assoc->sparql_key_attr, tmp);
+    g_free (tmp);
     break;
 
   case G_TYPE_INT:



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