Using non-utf8 strlen for titles in completion should suffice

This commit is contained in:
Christian Dywan 2009-04-13 22:43:07 +02:00
parent c27642e912
commit a324cad92a
2 changed files with 2 additions and 3 deletions

View file

@ -541,11 +541,10 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
temp = g_utf8_strdown (title, -1); temp = g_utf8_strdown (title, -1);
if ((start = strstr (temp, key))) if ((start = strstr (temp, key)))
{ {
size_t utf8_len = g_utf8_strlen (key, -1);
if (!len) if (!len)
len = strlen (key); len = strlen (key);
skey = g_malloc0 (len + 1); 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); parts = g_strsplit (title, skey, 2);
if (parts && parts[0] && parts[1]) if (parts && parts[0] && parts[1])
desc_title = g_markup_printf_escaped ("%s<b>%s</b>%s", desc_title = g_markup_printf_escaped ("%s<b>%s</b>%s",

View file

@ -31,7 +31,7 @@ static const CompletionItem items[] = {
{ "http://one.com/one/", "One off" }, { "http://one.com/one/", "One off" },
{ "http://four.org", "One" }, { "http://four.org", "One" },
{ "https://four.org", "Four" }, { "https://four.org", "Four" },
{ "ftp://four.org/", "Five" }, { "ftp://four.org/", "ごオルゴ" },
{ "http://muenchen.de/weißwürste/", "Münchner Weißwürste" }, /* Umlauts */ { "http://muenchen.de/weißwürste/", "Münchner Weißwürste" }, /* Umlauts */
}; };
static const guint items_n = 9; static const guint items_n = 9;