]> spindle.queued.net Git - midori/commitdiff
Avoid string split in midori_location_action_popup_timeout_cb
authorChristian Dywan <christian@twotoasts.de>
Mon, 20 Feb 2012 20:58:03 +0000 (21:58 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 20 Feb 2012 20:58:03 +0000 (21:58 +0100)
midori/midori-locationaction.c

index 93061b9b97d42a0d0bc836d12fcfed0fbb21f7a2..ea42789fc3eeb318cfa77648a93f0f28e9965aa0 100644 (file)
@@ -418,20 +418,14 @@ midori_location_action_popup_timeout_cb (gpointer data)
         return FALSE;
 
     /* No completion when typing a search token */
-    if (action->search_engines != NULL)
+    if (action->search_engines
+     && katze_array_find_token (action->search_engines, action->key))
     {
-        gchar** parts = g_strsplit (action->key, " ", 2);
-        if (parts && *parts && parts[1]
-                  && katze_array_find_token (action->search_engines, *parts))
-        {
-            g_strfreev (parts);
-            midori_location_action_popdown_completion (action);
-            return FALSE;
-        }
-        g_strfreev (parts);
+        midori_location_action_popdown_completion (action);
+        return FALSE;
     }
 
-    /* Empaty string or starting with a space means: no completion */
+    /* Empty string or starting with a space means: no completion */
     if (!(action->key && *action->key && *action->key != ' '))
     {
         midori_location_action_popdown_completion (action);