[glib] glib: fix locale detection on android
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] glib: fix locale detection on android
- Date: Fri, 27 Jul 2012 17:42:18 +0000 (UTC)
commit ad4f780cb427c1c37c0b0d87fac867285926eb16
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Fri Jul 27 14:52:17 2012 +0200
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
glib/guniprop.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/glib/guniprop.c b/glib/guniprop.c
index 420d58a..c56f8d7 100644
--- a/glib/guniprop.c
+++ b/glib/guniprop.c
@@ -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])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]