1 --- fputws.c.orig 2004-11-25 11:38:34.000000000 -0800
2 +++ fputws.c 2005-02-23 17:23:49.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/fputws.c,v 1.6 2004/07/21 10:54:57 tjr Exp $");
7 +#include "xlocale_private.h"
16 -fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
17 +fputws_l(const wchar_t * __restrict ws, FILE * __restrict fp, locale_t loc)
23 + size_t (*__wcsnrtombs)(char * __restrict, const wchar_t ** __restrict,
24 + size_t, size_t, mbstate_t * __restrict, locale_t);
26 + NORMALIZE_LOCALE(loc);
27 + __wcsnrtombs = loc->__lc_ctype->__wcsnrtombs;
30 if (prepwrite(fp) != 0)
34 nbytes = __wcsnrtombs(buf, &ws, SIZE_T_MAX, sizeof(buf),
35 - &fp->_extra->mbstate);
36 + &fp->_extra->mbstate, loc);
37 if (nbytes == (size_t)-1)
39 iov.iov_len = uio.uio_resid = nbytes;
46 +fputws(const wchar_t * __restrict ws, FILE * __restrict fp)
48 + return fputws_l(ws, fp, __current_locale());