1 --- mbsrtowcs.c.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ mbsrtowcs.c 2009-11-09 15:05:25.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/locale/mbsrtowcs.c,v 1.6 2004/07/21 10:54:57 tjr Exp $");
7 +#include "xlocale_private.h"
12 @@ -34,12 +36,18 @@ __FBSDID("$FreeBSD: src/lib/libc/locale/
16 +mbsrtowcs_l(wchar_t * __restrict dst, const char ** __restrict src, size_t len,
17 + mbstate_t * __restrict ps, locale_t loc)
19 + NORMALIZE_LOCALE(loc);
21 + ps = &loc->__mbs_mbsrtowcs;
22 + return (loc->__lc_ctype->__mbsnrtowcs(dst, src, SIZE_T_MAX, len, ps, loc));
26 mbsrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t len,
27 mbstate_t * __restrict ps)
29 - static mbstate_t mbs;
33 - return (__mbsnrtowcs(dst, src, SIZE_T_MAX, len, ps));
34 + return mbsrtowcs_l(dst, src, len, ps, __current_locale());