1 --- wctomb.c.orig 2004-11-25 11:38:20.000000000 -0800
2 +++ wctomb.c 2005-02-18 18:40:43.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/locale/wctomb.c,v 1.8 2004/07/29 06:18:40 tjr Exp $");
7 +#include "xlocale_private.h"
14 -wctomb(char *s, wchar_t wchar)
15 +wctomb_l(char *s, wchar_t wchar, locale_t loc)
17 static const mbstate_t initial;
18 - static mbstate_t mbs;
21 + NORMALIZE_LOCALE(loc);
23 /* No support for state dependent encodings. */
25 + loc->__mbs_wctomb = initial;
28 - if ((rval = __wcrtomb(s, wchar, &mbs)) == (size_t)-1)
29 + if ((rval = loc->__lc_ctype->__wcrtomb(s, wchar, &loc->__mbs_wctomb, loc)) == (size_t)-1)
35 +wctomb(char *s, wchar_t wchar)
37 + return wctomb_l(s, wchar, __current_locale());