]> spindle.queued.net Git - midori/commitdiff
Using non-utf8 strlen for titles in completion should suffice
authorChristian Dywan <christian@twotoasts.de>
Mon, 13 Apr 2009 20:43:07 +0000 (22:43 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 13 Apr 2009 20:43:07 +0000 (22:43 +0200)
midori/midori-locationaction.c
tests/completion.c

index 86aa3c7bc1b28cf3c394f50b634d468eac5bda34..030f83d94764cd4f6c678385b7c9a592e4da1ce6 100644 (file)
@@ -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<b>%s</b>%s",
index 6b6879eed7c5b38c1e3f75e8b3c3428bbfbb7e1d..86ddb5dfb89d8a236c5a1afb6b9e339633cece0a 100644 (file)
@@ -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;