aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@src.gnome.org>2009-01-20 23:46:58 +0800
committerGustavo Noronha Silva <gns@src.gnome.org>2009-01-20 23:46:58 +0800
commitabc8a6c2741dacc79ae54c158f0d011faf982d7c (patch)
treee32093c382fd0b99c7c40ea134ef9e2acf89bc86
parent5f799768c70a98847c91d575266392ed277eed40 (diff)
downloadgsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar.gz
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar.bz2
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar.lz
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar.xz
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.tar.zst
gsoc2013-epiphany-abc8a6c2741dacc79ae54c158f0d011faf982d7c.zip
Avoid adding problematic search terms with spaces
Adding spaces to the end of the location bar was adding bad search terms. This fixes it. svn path=/branches/gnome-2-26/; revision=8711
-rw-r--r--lib/widgets/ephy-location-entry.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index c4bdda179..791879241 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -435,12 +435,17 @@ editable_changed_cb (GtkEditable *editable,
tmp = g_regex_escape_string (current, count);
term = g_regex_replace (quote_regex, tmp, -1, 0,
"", G_REGEX_MATCH_NOTEMPTY, NULL);
+ g_strstrip (term);
g_free (tmp);
- term_regex = g_regex_new (g_strstrip (term),
- G_REGEX_CASELESS | G_REGEX_OPTIMIZE,
- G_REGEX_MATCH_NOTEMPTY, NULL);
- priv->search_terms = g_slist_append (priv->search_terms, term_regex);
+ /* we don't want empty search terms */
+ if (term[0] != '\0')
+ {
+ term_regex = g_regex_new (term,
+ G_REGEX_CASELESS | G_REGEX_OPTIMIZE,
+ G_REGEX_MATCH_NOTEMPTY, NULL);
+ priv->search_terms = g_slist_append (priv->search_terms, term_regex);
+ }
g_free (term);
/* count will be incremented by the for loop */