summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2006-11-05 16:39:19 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2006-11-05 16:39:19 +0000
commite12d2c506c05c15436e25f61169a0a7826e3a75f (patch)
tree1c4e3908780786c899d3156f69f3cda71363e1af
parent9e5cb85732624f95a5df829cd78f9c45a18b7c16 (diff)
downloadyelp-e12d2c506c05c15436e25f61169a0a7826e3a75f.tar.gz
Replace ':' chars in search strings with ' ' Stops from crashing (bug
* src/yelp-search-pager.c: Replace ':' chars in search strings with ' ' Stops from crashing (bug #364768) Don't chew memory when search string contains 2 consecutive spaces
-rw-r--r--ChangeLog9
-rw-r--r--src/yelp-search-pager.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 234e74e8..8f43c31a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-11-05 Don Scorgie <dscorgie@cvs.gnome.org>
+
+ * src/yelp-search-pager.c:
+ Replace ':' chars in search strings with ' '
+ Stops from crashing (bug #364768)
+ Don't chew memory when search string contains
+ 2 consecutive spaces
+
+
2006-10-25 Don Scorgie <dscorgie@cvs.gnome.org>
* src/yelp-info-parser.c:
diff --git a/src/yelp-search-pager.c b/src/yelp-search-pager.c
index 1c7e0dec..63aa8edc 100644
--- a/src/yelp-search-pager.c
+++ b/src/yelp-search-pager.c
@@ -1321,14 +1321,16 @@ build_lists (gchar *search_terms, gchar ***terms, gint **dups,
} else {
suffixes = NULL;
}
-
+ search_terms = g_strdelimit (search_terms, ":", ' ');
list_copy = g_strsplit (g_utf8_casefold (g_strstrip (
search_terms), -1),
" ", -1);
for (iter = list_copy; *iter != NULL; iter++) {
gboolean ignoring = FALSE;
-
+ if (strlen (*iter) == 0) {
+ continue;
+ }
if (g_str_has_suffix (*iter, "?")) {
gchar *tmp;
tmp = g_strndup (*iter, strlen (*iter) - 1);
@@ -1482,7 +1484,6 @@ slow_search_setup (YelpSearchPager *pager)
&dup_list, &stop_list,
&required_no);
-
while (omf_pending) {
GSList *first = NULL;
gchar *file = NULL;
@@ -1620,7 +1621,6 @@ slow_search_setup (YelpSearchPager *pager)
xmlFreeDoc (omf_doc);
}
-
g_return_val_if_fail (priv->slow_search_process_id == 0, FALSE);
priv->slow_search_process_id =
g_idle_add ((GSourceFunc) slow_search_process, pager);