From 388169d0d00935088da72b907778172451e3eb35 Mon Sep 17 00:00:00 2001 From: Martin Wehner Date: Mon, 30 Jul 2007 21:13:58 +0000 Subject: Don't try to lowercase non-unicode filenames with g_utf8_strdown. Fixes 2007-07-30 Martin Wehner * libnautilus-private/nautilus-search-engine-simple.c: (search_visit_func): Don't try to lowercase non-unicode filenames with g_utf8_strdown. Fixes #454799. Patch from Jan de Groot svn path=/trunk/; revision=13033 --- ChangeLog | 7 +++++++ libnautilus-private/nautilus-search-engine-simple.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 052857720..58b2f939b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-07-30 Martin Wehner + + * libnautilus-private/nautilus-search-engine-simple.c: + (search_visit_func): Don't try to lowercase non-unicode + filenames with g_utf8_strdown. Fixes #454799. + Patch from Jan de Groot + 2007-07-28 Martin Wehner * src/file-manager/fm-properties-window.c: diff --git a/libnautilus-private/nautilus-search-engine-simple.c b/libnautilus-private/nautilus-search-engine-simple.c index 5765399ad..897503bdd 100644 --- a/libnautilus-private/nautilus-search-engine-simple.c +++ b/libnautilus-private/nautilus-search-engine-simple.c @@ -213,8 +213,13 @@ search_visit_func (const gchar *rel_path, hit = FALSE; if (!is_hidden) { - normalized = g_utf8_normalize (info->name, -1, G_NORMALIZE_NFD); - lower_name = g_utf8_strdown (normalized, -1); + if (g_utf8_validate (info->name, -1, NULL)) { + normalized = g_utf8_normalize (info->name, -1, G_NORMALIZE_NFD); + lower_name = g_utf8_strdown (normalized, -1); + g_free (normalized); + } else { + lower_name = g_ascii_strdown (info->name, -1); + } hit = TRUE; for (i = 0; data->words[i] != NULL; i++) { @@ -224,7 +229,6 @@ search_visit_func (const gchar *rel_path, } } g_free (lower_name); - g_free (normalized); } if (hit && data->mime_types != NULL) { -- cgit v1.2.1