[tracker/tracker-0.10] libtracker-data: Do not insert bogus extra data for anon blank nodes



commit 34edafd1768aac086909629f7e2ef8d2418e9034
Author: Jürg Billeter <j bitron ch>
Date:   Thu Apr 7 10:46:14 2011 +0200

    libtracker-data: Do not insert bogus extra data for anon blank nodes
    
    Fixes NB#244536.

 src/libtracker-data/tracker-data-update.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index df9322f..dfbec66 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2307,7 +2307,7 @@ tracker_data_insert_statement (const gchar            *graph,
 }
 
 
-static void
+static gboolean
 handle_blank_node (const gchar  *subject,
                    const gchar  *predicate,
                    const gchar  *object,
@@ -2325,7 +2325,7 @@ handle_blank_node (const gchar  *subject,
 
 			if (actual_error) {
 				g_propagate_error (error, actual_error);
-				return;
+				return FALSE;
 			}
 		}
 	}
@@ -2340,12 +2340,14 @@ handle_blank_node (const gchar  *subject,
 
 		if (actual_error) {
 			g_propagate_error (error, actual_error);
-			return;
+			return FALSE;
 		}
 
-		return;
+		return TRUE;
 	} else {
 		g_critical ("Blank node '%s' not found", object);
+
+		return FALSE;
 	}
 }
 
@@ -2388,7 +2390,9 @@ tracker_data_insert_statement_with_uri (const gchar            *graph,
 
 	/* subjects and objects starting with `:' are anonymous blank nodes */
 	if (g_str_has_prefix (object, ":")) {
-		handle_blank_node (subject, predicate, object, graph, &actual_error);
+		if (handle_blank_node (subject, predicate, object, graph, &actual_error)) {
+			return;
+		}
 
 		if (actual_error) {
 			g_propagate_error (error, actual_error);
@@ -2595,8 +2599,9 @@ tracker_data_update_statement_with_uri (const gchar            *graph,
 
 	/* subjects and objects starting with `:' are anonymous blank nodes */
 	if (g_str_has_prefix (object, ":")) {
-
-		handle_blank_node (subject, predicate, object, graph, &actual_error);
+		if (handle_blank_node (subject, predicate, object, graph, &actual_error)) {
+			return;
+		}
 
 		if (actual_error) {
 			g_propagate_error (error, actual_error);



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