]> spindle.queued.net Git - midori/commitdiff
Skip NULL key, which is the case when using the combo arrow
authorChristian Dywan <christian@twotoasts.de>
Sun, 22 Aug 2010 01:25:03 +0000 (03:25 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sun, 22 Aug 2010 01:25:03 +0000 (03:25 +0200)
midori/midori-locationaction.c

index 2e583f1af71b8ecda70eade44ef0e186289d2623..84f2009786bc158e9f1e49ed7b54a1e92e66f9dc 100644 (file)
@@ -1043,7 +1043,6 @@ midori_location_entry_render_text_cb (GtkCellLayout*   layout,
     gchar* temp_concat;
     gchar* temp_markup;
     gchar** parts;
-    size_t len;
     size_t offset;
 
     gtk_tree_model_get (model, iter, URI_COL, &uri, TITLE_COL, &title,
@@ -1074,10 +1073,10 @@ midori_location_entry_render_text_cb (GtkCellLayout*   layout,
         desc_iter = uri;
         key_idx = 0;
         key = keys[key_idx];
-        len = strlen (key);
         offset = 0;
-        while ((start = strstr (temp_iter, key)) && start)
+        while (key && (start = strstr (temp_iter, key)) && start)
         {
+            gsize len = strlen (key);
             if (len)
             {
                 offset = (start - temp_iter);
@@ -1110,7 +1109,6 @@ midori_location_entry_render_text_cb (GtkCellLayout*   layout,
             key = keys[key_idx];
             if (key == NULL)
                 break;
-            len = strlen (key);
         }
         if (key)
             katze_assign (desc_uri, NULL);
@@ -1132,10 +1130,10 @@ midori_location_entry_render_text_cb (GtkCellLayout*   layout,
         desc_iter = title;
         key_idx = 0;
         key = keys[key_idx];
-        len = strlen (key);
         offset = 0;
-        while ((start = strstr (temp_iter, key)) && start)
+        while (key && (start = strstr (temp_iter, key)) && start)
         {
+            gsize len = strlen (key);
             if (len)
             {
                 offset = (start - temp_iter);
@@ -1168,7 +1166,6 @@ midori_location_entry_render_text_cb (GtkCellLayout*   layout,
             key = keys[key_idx];
             if (key == NULL)
                 break;
-            len = strlen (key);
         }
         if (key)
             katze_assign (desc_title, NULL);