X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/3d9156a7a519a5e3aa1b92e9d9d4b991f1aed7ff..15de9d6b4ab2de27ae24b13b7b6c4d55fffe4aef:/locale/FreeBSD/btowc.c?ds=sidebyside diff --git a/locale/FreeBSD/btowc.c b/locale/FreeBSD/btowc.c index 44b501e..38122e7 100644 --- a/locale/FreeBSD/btowc.c +++ b/locale/FreeBSD/btowc.c @@ -27,18 +27,21 @@ #include __FBSDID("$FreeBSD: src/lib/libc/locale/btowc.c,v 1.4 2004/05/12 14:26:54 tjr Exp $"); +#include "xlocale_private.h" + #include #include #include "mblocal.h" wint_t -btowc(int c) +btowc_l(int c, locale_t loc) { static const mbstate_t initial; mbstate_t mbs = initial; char cc; wchar_t wc; + NORMALIZE_LOCALE(loc); if (c == EOF) return (WEOF); /* @@ -47,7 +50,13 @@ btowc(int c) * counts. */ cc = (char)c; - if (__mbrtowc(&wc, &cc, 1, &mbs) > 1) + if (loc->__lc_ctype->__mbrtowc(&wc, &cc, 1, &mbs, loc) > 1) return (WEOF); return (wc); } + +wint_t +btowc(int c) +{ + return btowc_l(c, __current_locale()); +}