summaryrefslogtreecommitdiff
path: root/src/wchar/mbsinit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wchar/mbsinit.c')
-rw-r--r--src/wchar/mbsinit.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/wchar/mbsinit.c b/src/wchar/mbsinit.c
index 52640483..9b41e2a2 100644
--- a/src/wchar/mbsinit.c
+++ b/src/wchar/mbsinit.c
@@ -1,12 +1,16 @@
-#if 0
-
#include <wchar.h>
+#include "_wchar.h"
int mbsinit(const mbstate_t * ps)
{
SIGNAL_SAFE(0);
- if (ps == NULL || *ps == 0) {
+ if (ps == NULL || ps->__impl == NULL) {
+ return 1;
+ }
+
+ struct __mbstate_t *m = ps->__impl;
+ if (m->ctype_epoch == 0 && m->dir == NONE && m->mbs == NULL && m->wcs == NULL) {
return 1;
}
@@ -16,6 +20,3 @@ int mbsinit(const mbstate_t * ps)
/*
STDC(199409)
*/
-
-
-#endif