[PATCH 6/8] tracker: escape strings on sparql updates
- From: lionel g landwerlin linux intel com
- To: grilo-list gnome org
- Subject: [PATCH 6/8] tracker: escape strings on sparql updates
- Date: Wed, 30 Mar 2011 11:36:25 +0100
From: Lionel Landwerlin <lionel g landwerlin linux intel com>
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:
--
1.7.4.1
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]