summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wehner <martin.wehner@gmail.com>2007-07-30 21:13:58 +0000
committerMartin Wehner <mwehner@src.gnome.org>2007-07-30 21:13:58 +0000
commit388169d0d00935088da72b907778172451e3eb35 (patch)
tree31a6cecc572db76736149d76fe566ed56d80eb4f
parente2e5a0d6e50917e7f1256caaa6268e81eb68c6b0 (diff)
downloadnautilus-388169d0d00935088da72b907778172451e3eb35.tar.gz
Don't try to lowercase non-unicode filenames with g_utf8_strdown. Fixes
2007-07-30 Martin Wehner <martin.wehner@gmail.com> * 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 <jan@jgc.homeip.net> svn path=/trunk/; revision=13033
-rw-r--r--ChangeLog7
-rw-r--r--libnautilus-private/nautilus-search-engine-simple.c10
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 <martin.wehner@gmail.com>
+
+ * 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 <jan@jgc.homeip.net>
+
2007-07-28 Martin Wehner <martin.wehner@gmail.com>
* 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) {