summaryrefslogtreecommitdiff
path: root/thunar/thunar-path-entry.c
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2012-10-20 19:41:19 +0200
committerNick Schermer <nick@xfce.org>2012-10-20 19:42:30 +0200
commit3c9a18f548679a251b944c7caca40410d92a1b12 (patch)
tree5d20e428fff1315c9e68c12795f83237c5533e7b /thunar/thunar-path-entry.c
parentc55f3dc995138ce78d33525db62adddb4a744d4d (diff)
downloadthunar-3c9a18f548679a251b944c7caca40410d92a1b12.tar.gz
Don't abort on non-utf8 charaters.
Diffstat (limited to 'thunar/thunar-path-entry.c')
-rw-r--r--thunar/thunar-path-entry.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c
index b3c55597..0f628b47 100644
--- a/thunar/thunar-path-entry.c
+++ b/thunar/thunar-path-entry.c
@@ -915,10 +915,16 @@ thunar_path_entry_match_func (GtkEntryCompletion *completion,
/* determine the real file name for the iter */
gtk_tree_model_get (model, iter, THUNAR_COLUMN_FILE_NAME, &name, -1);
name_normalized = g_utf8_normalize (name, -1, G_NORMALIZE_ALL);
- g_free (name);
+ if (G_LIKELY (name_normalized != NULL))
+ g_free (name);
+ else
+ name_normalized = name;
/* check if we have a match here */
- matched = g_str_has_prefix (name_normalized, last_slash);
+ if (name_normalized != NULL)
+ matched = g_str_has_prefix (name_normalized, last_slash);
+ else
+ matched = FALSE;
/* cleanup */
g_free (name_normalized);