1 --- wcsrtombs.c.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ wcsrtombs.c 2009-11-09 15:05:26.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcsrtombs.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 +wcsrtombs_l(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
17 + mbstate_t * __restrict ps, locale_t loc)
19 + NORMALIZE_LOCALE(loc);
21 + ps = &loc->__mbs_wcsrtombs;
22 + return (loc->__lc_ctype->__wcsnrtombs(dst, src, SIZE_T_MAX, len, ps, loc));
26 wcsrtombs(char * __restrict dst, const wchar_t ** __restrict src, size_t len,
27 mbstate_t * __restrict ps)
29 - static mbstate_t mbs;
33 - return (__wcsnrtombs(dst, src, SIZE_T_MAX, len, ps));
34 + return wcsrtombs_l(dst, src, len, ps, __current_locale());