From a324cad92ab0a01ad2a83011b51d712423f6f2e9 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Mon, 13 Apr 2009 22:43:07 +0200 Subject: [PATCH] Using non-utf8 strlen for titles in completion should suffice --- midori/midori-locationaction.c | 3 +-- tests/completion.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 86aa3c7b..030f83d9 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -541,11 +541,10 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout, temp = g_utf8_strdown (title, -1); if ((start = strstr (temp, key))) { - size_t utf8_len = g_utf8_strlen (key, -1); if (!len) len = strlen (key); skey = g_malloc0 (len + 1); - g_utf8_strncpy (skey, title + (start - temp), utf8_len); + strncpy (skey, title + (start - temp), len); parts = g_strsplit (title, skey, 2); if (parts && parts[0] && parts[1]) desc_title = g_markup_printf_escaped ("%s%s%s", diff --git a/tests/completion.c b/tests/completion.c index 6b6879ee..86ddb5df 100644 --- a/tests/completion.c +++ b/tests/completion.c @@ -31,7 +31,7 @@ static const CompletionItem items[] = { { "http://one.com/one/", "One off" }, { "http://four.org", "One" }, { "https://four.org", "Four" }, - { "ftp://four.org/", "Five" }, + { "ftp://four.org/", "ごオルゴ" }, { "http://muenchen.de/weißwürste/", "Münchner Weißwürste" }, /* Umlauts */ }; static const guint items_n = 9;