glib: fix locale detection on android

g_utf8_strup() tries to call setlocale() before starting to compute
the length of its first argument. Calling setlocale() can return NULL
(as specified in the man page), and obviously that happens on android.

https://bugzilla.gnome.org/show_bug.cgi?id=680704
This commit is contained in:
Lionel Landwerlin
2012-07-27 14:52:17 +02:00
parent 3339a395c2
commit ad4f780cb4

View File

@@ -753,6 +753,9 @@ get_locale_type (void)
g_free (tem);
#else
const char *locale = setlocale (LC_CTYPE, NULL);
if (locale == NULL)
return LOCALE_NORMAL;
#endif
switch (locale[0])