[tracker/tracker-0.8] Fixes NB#170915 - tracker-search for snippet is resulting in errors
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] Fixes NB#170915 - tracker-search for snippet is resulting in errors
- Date: Thu, 27 May 2010 11:27:00 +0000 (UTC)
commit 061abcb43f82e780df4d70352fcacc8d7bf41f3d
Author: Martyn Russell <martyn lanedo com>
Date: Thu May 27 10:35:11 2010 +0100
Fixes NB#170915 - tracker-search for snippet is resulting in errors
src/tracker-utils/tracker-search.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index 723b3d6..a2b1375 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -1154,13 +1154,26 @@ main (int argc, char **argv)
g_thread_init (NULL);
}
- /* Check terms are not stopwords */
if (terms) {
TrackerLanguage *language;
GHashTable *stop_words;
const gchar *stop_word_found;
gchar **p;
+ /* Check terms don't have additional quotes */
+ for (p = terms; *p; p++) {
+ gchar *term = *p;
+ gint end = strlen (term) - 1;
+
+ if ((term[0] == '"' && term[end] == '"') ||
+ (term[0] == '\'' && term[end] == '\'')) {
+ /* We never have a quote JUST at the end */
+ term[0] = term[end] = ' ';
+ g_strstrip (term);
+ }
+ }
+
+ /* Check terms are not stopwords */
language = tracker_language_new (NULL);
stop_words = tracker_language_get_stop_words (language);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]