projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3339a39
)
glib: fix locale detection on android
author
Lionel Landwerlin
<llandwerlin@gmail.com>
Fri, 27 Jul 2012 12:52:17 +0000
(14:52 +0200)
committer
Lionel Landwerlin
<llandwerlin@gmail.com>
Fri, 27 Jul 2012 17:41:05 +0000
(19:41 +0200)
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
patch
|
blob
|
history
diff --git
a/glib/guniprop.c
b/glib/guniprop.c
index
420d58a
..
c56f8d7
100644
(file)
--- 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])