tracker r2689 - in trunk: . src/libtracker-common src/tracker-extract
- From: mottela svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2689 - in trunk: . src/libtracker-common src/tracker-extract
- Date: Wed, 10 Dec 2008 16:36:29 +0000 (UTC)
Author: mottela
Date: Wed Dec 10 16:36:29 2008
New Revision: 2689
URL: http://svn.gnome.org/viewvc/tracker?rev=2689&view=rev
Log:
Fixed support for empty strings as metadata values
Modified:
trunk/ChangeLog
trunk/src/libtracker-common/tracker-parser.c
trunk/src/tracker-extract/tracker-extract.c
Modified: trunk/src/libtracker-common/tracker-parser.c
==============================================================================
--- trunk/src/libtracker-common/tracker-parser.c (original)
+++ trunk/src/libtracker-common/tracker-parser.c Wed Dec 10 16:36:29 2008
@@ -939,10 +939,14 @@
g_return_val_if_fail (TRACKER_IS_LANGUAGE (language), NULL);
- if (text == NULL || text[0] == '\0') {
+ if (text == NULL) {
return NULL;
}
+ if (text[0] == '\0') {
+ return g_strdup ("");
+ }
+
p = text;
len = strlen (text);
len = MIN (len, 500);
Modified: trunk/src/tracker-extract/tracker-extract.c
==============================================================================
--- trunk/src/tracker-extract/tracker-extract.c (original)
+++ trunk/src/tracker-extract/tracker-extract.c Wed Dec 10 16:36:29 2008
@@ -263,19 +263,17 @@
value_utf8 = g_locale_to_utf8 (value, -1, NULL, NULL, NULL);
if (value_utf8) {
- if (value_utf8[0] != '\0') {
- /* Replace any embedded semicolons or "=" as we use them for delimiters */
- value_utf8 = g_strdelimit (value_utf8, ";", ',');
- value_utf8 = g_strdelimit (value_utf8, "=", '-');
- value_utf8 = g_strstrip (value_utf8);
-
- debug ("Extractor - Found '%s' = '%s'",
- (gchar*) key,
- value_utf8);
-
- g_print ("%s=%s;\n", (gchar*) key, value_utf8);
- }
-
+ /* Replace any embedded semicolons or "=" as we use them for delimiters */
+ value_utf8 = g_strdelimit (value_utf8, ";", ',');
+ value_utf8 = g_strdelimit (value_utf8, "=", '-');
+ value_utf8 = g_strstrip (value_utf8);
+
+ debug ("Extractor - Found '%s' = '%s'",
+ (gchar*) key,
+ value_utf8);
+
+ g_print ("%s=%s;\n", (gchar*) key, value_utf8);
+
g_free (value_utf8);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]