From e12d2c506c05c15436e25f61169a0a7826e3a75f Mon Sep 17 00:00:00 2001 From: Don Scorgie Date: Sun, 5 Nov 2006 16:39:19 +0000 Subject: 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 --- ChangeLog | 9 +++++++++ src/yelp-search-pager.c | 8 ++++---- 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 + + * 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 * 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); -- cgit v1.2.1