Deleted Added
full compact
33c33
< __FBSDID("$FreeBSD: head/lib/libc/stdio/fgetwc.c 227753 2011-11-20 14:45:42Z theraven $");
---
> __FBSDID("$FreeBSD: head/lib/libc/stdio/fgetwc.c 234799 2012-04-29 16:28:39Z das $");
61a62
>
69c70,73
< * Non-MT-safe version.
---
> * Internal (non-MPSAFE) version of fgetwc(). This version takes an
> * mbstate_t argument specifying the initial conversion state. For
> * wide streams, this should always be fp->_mbstate. On return, *nread
> * is set to the number of bytes read.
71,72c75,76
< wint_t
< __fgetwc(FILE *fp, locale_t locale)
---
> wint_t
> __fgetwc_mbs(FILE *fp, mbstate_t *mbs, int *nread, locale_t locale)
78c82,83
< if (fp->_r <= 0 && __srefill(fp))
---
> if (fp->_r <= 0 && __srefill(fp)) {
> *nread = 0;
79a85
> }
83a90
> *nread = 1;
85a93
> *nread = 0;
87c95
< nconv = l->__mbrtowc(&wc, fp->_p, fp->_r, &fp->_mbstate);
---
> nconv = l->__mbrtowc(&wc, fp->_p, fp->_r, mbs);
93,96d100
< /*
< * Assume that the only valid representation of
< * the null wide character is a single null byte.
< */
98a103
> (*nread)++;
102a108
> *nread += nconv;