summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nonstd/__libc.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/nonstd/__libc.c b/src/nonstd/__libc.c
index 354dee9b..f596a3c8 100644
--- a/src/nonstd/__libc.c
+++ b/src/nonstd/__libc.c
@@ -32,11 +32,35 @@ void *__libc(LIBC_INTERNAL variable)
break;
case CTYPE:
- r = __libc_per_thread(THREAD_LOCALE);
- if (!r) {
+ r = __libc(THREAD_LOCALE);
+ if (((struct __locale_t*)r)->ctype[0] == '\0') {
+ r = &locale;
+ }
+ r = ((struct __locale_t*)r)->lc_ctype.ctattr;
+ break;
+
+ case TOLOWER:
+ r = __libc(THREAD_LOCALE);
+ if (((struct __locale_t*)r)->ctype[0] == '\0') {
+ r = &locale;
+ }
+ r = ((struct __locale_t*)r)->lc_ctype.ctolower;
+ break;
+
+ case TOUPPER:
+ r = __libc(THREAD_LOCALE);
+ if (((struct __locale_t*)r)->ctype[0] == '\0') {
+ r = &locale;
+ }
+ r = ((struct __locale_t*)r)->lc_ctype.ctoupper;
+ break;
+
+ case LCONV:
+ r = __libc(THREAD_LOCALE);
+ if (((struct __locale_t*)r)->numeric[0] == '\0') {
r = &locale;
}
- r = ((struct __locale_t*)r)->ctype;
+ r = &(((struct __locale_t*)r)->mn);
break;
case SYSCALL_LOOKUP: