mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
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:
@@ -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])
|
||||
|
Reference in New Issue
Block a user