aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ephy-location-action.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ephy-location-action.c b/src/ephy-location-action.c
index b244389fa..3d7ef7838 100644
--- a/src/ephy-location-action.c
+++ b/src/ephy-location-action.c
@@ -150,8 +150,8 @@ completion_func (GtkEntryCompletion *completion,
{
int i, len_key, len_prefix;
char *item = NULL;
- char *keywords = NULL;
char *url = NULL;
+ char *keywords = NULL;
gboolean ret = FALSE;
GtkTreeModel *model;
GtkTreeIter iter2;
@@ -163,8 +163,8 @@ completion_func (GtkEntryCompletion *completion,
gtk_tree_model_get (model, iter,
EPHY_COMPLETION_TEXT_COL, &item,
- EPHY_COMPLETION_KEYWORDS_COL, &keywords,
EPHY_COMPLETION_URL_COL, &url,
+ EPHY_COMPLETION_KEYWORDS_COL, &keywords,
-1);
len_key = strlen (key);
@@ -176,6 +176,10 @@ completion_func (GtkEntryCompletion *completion,
{
ret = TRUE;
}
+ else if (!strncasecmp (key, url, len_key))
+ {
+ ret = TRUE;
+ }
else
{
for (i = 0; i < G_N_ELEMENTS (web_prefixes); i++)
@@ -187,6 +191,13 @@ completion_func (GtkEntryCompletion *completion,
ret = TRUE;
break;
}
+ else if (!strncmp (web_prefixes[i].prefix, url, len_prefix) &&
+ !strncasecmp (key, url + len_prefix, len_key))
+ {
+ ret = TRUE;
+ break;
+ }
+
}
}
@@ -206,8 +217,8 @@ completion_func (GtkEntryCompletion *completion,
ret = FALSE;
g_free (item);
- g_free (keywords);
g_free (url);
+ g_free (keywords);
return ret;
}