[Xfce4-commits] <midori:master> Skip NULL key, which is the case when using the combo arrow
Christian Dywan
noreply at xfce.org
Sun Aug 22 03:36:05 CEST 2010
Updating branch refs/heads/master
to 0de4e9fa08409649d2d42f769f655e7977cb83d0 (commit)
from ac1ba277e445a3741a8f085382eb5968c787b854 (commit)
commit 0de4e9fa08409649d2d42f769f655e7977cb83d0
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Aug 22 03:25:03 2010 +0200
Skip NULL key, which is the case when using the combo arrow
midori/midori-locationaction.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c
index 2e583f1..84f2009 100644
--- a/midori/midori-locationaction.c
+++ b/midori/midori-locationaction.c
@@ -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);
More information about the Xfce4-commits
mailing list