1 --- mbtowc.c.orig Thu Nov 25 11:38:18 2004
2 +++ mbtowc.c Fri Feb 18 17:12:35 2005
5 __FBSDID("$FreeBSD: src/lib/libc/locale/mbtowc.c,v 1.11 2004/07/29 06:18:40 tjr Exp $");
7 +#include "xlocale_private.h"
14 -mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n)
15 +mbtowc_l(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
18 static const mbstate_t initial;
19 - static mbstate_t mbs;
22 + NORMALIZE_LOCALE(loc);
24 /* No support for state dependent encodings. */
26 + loc->__mbs_mbtowc = initial;
29 - rval = __mbrtowc(pwc, s, n, &mbs);
30 + rval = loc->__lc_ctype->__mbrtowc(pwc, s, n, &loc->__mbs_mbtowc, loc);
31 if (rval == (size_t)-1 || rval == (size_t)-2)
37 +mbtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n)
39 + return mbtowc_l(pwc, s, n, __current_locale());