projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix x32 unistd macros to report as ILP32 not LP64
[musl]
/
src
/
locale
/
langinfo.c
diff --git
a/src/locale/langinfo.c
b/src/locale/langinfo.c
index
d3c90d9
..
b16caf4
100644
(file)
--- a/
src/locale/langinfo.c
+++ b/
src/locale/langinfo.c
@@
-34,26
+34,30
@@
char *__nl_langinfo_l(nl_item item, locale_t loc)
const char *str;
if (item == CODESET) return MB_CUR_MAX==1 ? "ASCII" : "UTF-8";
const char *str;
if (item == CODESET) return MB_CUR_MAX==1 ? "ASCII" : "UTF-8";
+
+ /* _NL_LOCALE_NAME extension */
+ if (idx == 65535 && cat < LC_ALL)
+ return loc->cat[cat] ? (char *)loc->cat[cat]->name : "C";
switch (cat) {
case LC_NUMERIC:
switch (cat) {
case LC_NUMERIC:
- if (idx > 1) return
NULL
;
+ if (idx > 1) return
""
;
str = c_numeric;
break;
case LC_TIME:
str = c_numeric;
break;
case LC_TIME:
- if (idx > 0x31) return
NULL
;
+ if (idx > 0x31) return
""
;
str = c_time;
break;
case LC_MONETARY:
str = c_time;
break;
case LC_MONETARY:
- if (idx > 0) return
NULL
;
+ if (idx > 0) return
""
;
str = "";
break;
case LC_MESSAGES:
str = "";
break;
case LC_MESSAGES:
- if (idx > 3) return
NULL
;
+ if (idx > 3) return
""
;
str = c_messages;
break;
default:
str = c_messages;
break;
default:
- return
NULL
;
+ return
""
;
}
for (; idx; idx--, str++) for (; *str; str++);
}
for (; idx; idx--, str++) for (; *str; str++);