1 --- ungetwc.c.orig 2004-11-25 11:38:35.000000000 -0800
2 +++ ungetwc.c 2005-02-23 17:38:14.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/stdio/ungetwc.c,v 1.9 2004/07/20 08:27:27 tjr Exp $");
7 +#include "xlocale_private.h"
13 * Non-MT-safe version.
16 -__ungetwc(wint_t wc, FILE *fp)
17 +__ungetwc(wint_t wc, FILE *fp, locale_t loc)
24 - if ((len = __wcrtomb(buf, wc, &fp->_extra->mbstate)) == (size_t)-1) {
25 + if ((len = loc->__lc_ctype->__wcrtomb(buf, wc, &fp->_extra->mbstate, loc)) == (size_t)-1) {
33 - r = __ungetwc(wc, fp);
34 + r = __ungetwc(wc, fp, __current_locale());
41 +ungetwc_l(wint_t wc, FILE *fp, locale_t loc)
45 + NORMALIZE_LOCALE(loc);
48 + r = __ungetwc(wc, fp, loc);