projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57b97b4
)
fix nl_langinfo_l(CODESET, loc) reporting wrong locale's value
author
Rich Felker
<dalias@aerifal.cx>
Wed, 7 Mar 2018 16:22:38 +0000
(11:22 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 7 Mar 2018 16:22:38 +0000
(11:22 -0500)
use of MB_CUR_MAX encoded a hidden dependency on the currently active
locale for the calling thread, whereas nl_langinfo_l is supposed to
report for the locale passed as an argument.
src/locale/langinfo.c
patch
|
blob
|
history
diff --git
a/src/locale/langinfo.c
b/src/locale/langinfo.c
index b16caf44e6bf298b9f145fac9456d2b69f180ab7..83be643300bb8f55ec4b47ed96709f5b43921dec 100644
(file)
--- a/
src/locale/langinfo.c
+++ b/
src/locale/langinfo.c
@@
-33,7
+33,7
@@
char *__nl_langinfo_l(nl_item item, locale_t loc)
int idx = item & 65535;
const char *str;
- if (item == CODESET) return
MB_CUR_MAX==1 ? "ASCII" : "UTF-8
";
+ if (item == CODESET) return
loc->cat[LC_CTYPE] ? "UTF-8" : "ASCII
";
/* _NL_LOCALE_NAME extension */
if (idx == 65535 && cat < LC_ALL)