aboutsummaryrefslogtreecommitdiffstats
path: root/lib/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'lib/widgets')
-rw-r--r--lib/widgets/ephy-location-entry.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index fae13d5fe..ff84fa3fe 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -357,7 +357,7 @@ editable_changed_cb (GtkEditable *editable,
char *term;
GRegex *term_regex;
GRegex *quote_regex;
- guint count;
+ gint count;
gboolean inside_quotes = FALSE;
quote_regex = g_regex_new ("\"", G_REGEX_OPTIMIZE,
@@ -388,6 +388,15 @@ editable_changed_cb (GtkEditable *editable,
if (((ptr[0] == ' ') && (!inside_quotes)) || ptr[1] == '\0')
{
/*
+ * We special-case the end of the line because
+ * we would otherwise not copy the last character
+ * of the search string, since the for loop will
+ * stop before that.
+ */
+ if (ptr[1] == '\0')
+ count++;
+
+ /*
* remove quotes, and quote any regex-sensitive
* characters
*/
@@ -402,7 +411,8 @@ editable_changed_cb (GtkEditable *editable,
priv->search_terms = g_slist_append (priv->search_terms, term_regex);
g_free (term);
- count = 0;
+ /* count will be incremented by the for loop */
+ count = -1;
current = ptr + 1;
}
}