1 --- wcrtomb.c.orig 2009-11-09 15:05:25.000000000 -0800
2 +++ wcrtomb.c 2009-11-09 15:05:26.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wcrtomb.c,v 1.8 2004/05/12 14:09:04 tjr Exp $");
7 +#include "xlocale_private.h"
13 -wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
14 +wcrtomb_l(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps,
17 - static mbstate_t mbs;
19 + NORMALIZE_LOCALE(loc);
22 - return (__wcrtomb(s, wc, ps));
23 + ps = &loc->__mbs_wcrtomb;
24 + return (loc->__lc_ctype->__wcrtomb(s, wc, ps, loc));
28 +wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
30 + return wcrtomb_l(s, wc, ps, __current_locale());