---- btowc.c.orig Thu Nov 25 11:38:16 2004
-+++ btowc.c Fri Feb 18 15:58:50 2005
+--- btowc.c.orig 2009-11-09 15:05:25.000000000 -0800
++++ btowc.c 2009-11-09 15:05:25.000000000 -0800
@@ -27,18 +27,21 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/locale/btowc.c,v 1.4 2004/05/12 14:26:54 tjr Exp $");
if (c == EOF)
return (WEOF);
/*
-@@ -47,7 +50,13 @@
+@@ -47,7 +50,13 @@ btowc(int c)
* counts.
*/
cc = (char)c;
+ 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());
- }
++}