[gnome-builder] project-tree: use strcmp instead of g_utf8_collate to compare collation keys
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] project-tree: use strcmp instead of g_utf8_collate to compare collation keys
- Date: Sun, 19 Jul 2015 19:50:19 +0000 (UTC)
commit 6e6f1f8cb38e442f771c396b1a5e1f40c822e571
Author: Ting-Wei Lan <lantw src gnome org>
Date: Wed Jul 15 00:25:54 2015 +0800
project-tree: use strcmp instead of g_utf8_collate to compare collation keys
It seems it is possible for g_utf8_collate_key_for_filename() to return an
invalid UTF-8 string, which causes crashes in g_utf8_collate() because the
string cannot be normalized. According to the documentation of
g_utf8_collate_key_for_filename(), we should just use strcmp() to compare
its return value.
https://bugzilla.gnome.org/show_bug.cgi?id=752265
src/project-tree/gb-project-file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/project-tree/gb-project-file.c b/src/project-tree/gb-project-file.c
index 6ee4486..5889938 100644
--- a/src/project-tree/gb-project-file.c
+++ b/src/project-tree/gb-project-file.c
@@ -54,7 +54,7 @@ gb_project_file_compare (GbProjectFile *a,
casefold_a = g_utf8_collate_key_for_filename (display_name_a, -1);
casefold_b = g_utf8_collate_key_for_filename (display_name_b, -1);
- ret = g_utf8_collate (casefold_a, casefold_b);
+ ret = strcmp (casefold_a, casefold_b);
g_free (casefold_a);
g_free (casefold_b);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]