diff options
author | Emmanuel Fleury <emmanuel.fleury@u-bordeaux.fr> | 2019-05-14 13:35:49 +0200 |
---|---|---|
committer | Emmanuel Fleury <emmanuel.fleury@u-bordeaux.fr> | 2019-05-14 13:35:49 +0200 |
commit | 48d65634a55b72cf5b5cc4324448bee56814999e (patch) | |
tree | 24bb629a3fb8086c0067703038fb876d43ea01d6 /glib | |
parent | a1d5395f10fe6d85a1a99837716bd7bce94c31bb (diff) | |
download | glib-48d65634a55b72cf5b5cc4324448bee56814999e.tar.gz |
Handling U+0000 explicitely to avoid collision with other cases
Fix issue #135
Diffstat (limited to 'glib')
-rw-r--r-- | glib/guniprop.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/glib/guniprop.c b/glib/guniprop.c index cd3675fbf..9a79e4316 100644 --- a/glib/guniprop.c +++ b/glib/guniprop.c @@ -623,13 +623,19 @@ gunichar g_unichar_totitle (gunichar c) { unsigned int i; + + /* We handle U+0000 explicitely because some elements in + * title_table[i][1] may be null. */ + if (c == 0) + return c; + for (i = 0; i < G_N_ELEMENTS (title_table); ++i) { if (title_table[i][0] == c || title_table[i][1] == c || title_table[i][2] == c) return title_table[i][0]; } - + if (TYPE (c) == G_UNICODE_LOWERCASE_LETTER) return g_unichar_toupper (c); |