---- wctype.c.orig 2004-11-25 11:38:21.000000000 -0800
-+++ wctype.c 2005-02-27 02:15:11.000000000 -0800
-@@ -27,6 +27,8 @@
+--- wctype.c.orig 2005-10-17 23:42:33.000000000 -0700
++++ wctype.c 2005-10-17 23:44:47.000000000 -0700
+@@ -27,48 +27,63 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/locale/wctype.c,v 1.3 2004/03/27 08:59:21 tjr Exp $");
#include <ctype.h>
#include <string.h>
#include <wctype.h>
-@@ -36,34 +38,57 @@
- iswctype(wint_t wc, wctype_t charclass)
- {
++#include <limits.h>
+-#undef iswctype
+-int
+-iswctype(wint_t wc, wctype_t charclass)
+-{
+-
- return (__istype(wc, charclass));
-+ return (__istype_l(wc, charclass, __current_locale()));
-+}
-+
-+#undef iswctype_l
-+int
-+iswctype_l(wint_t wc, wctype_t charclass, locale_t loc)
-+{
-+ NORMALIZE_LOCALE(loc);
-+ return (__istype_l(wc, charclass, loc));
- }
-
+-}
+static struct {
+ const char *name;
+ wctype_t mask;
+ { "ideogram", _CTYPE_I }, /* BSD extension */
+ { "special", _CTYPE_T }, /* BSD extension */
+ { "phonogram", _CTYPE_Q }, /* BSD extension */
-+ { "rune", 0xFFFFFF00L }, /* BSD extension */
++ { "rune", 0xFFFFFFF0L }, /* BSD extension */
+ { NULL, 0UL }, /* Default */
+};
-+
-+/* these don't currently depend on the locale, but they could */
-+
+
wctype_t
- wctype(const char *property)
+-wctype(const char *property)
++wctype_l(const char *property, locale_t loc)
{
- struct {
- const char *name;
- { "rune", 0xFFFFFF00L }, /* BSD extension */
- { NULL, 0UL }, /* Default */
- };
-+ int i;
-+
-+ i = 0;
-+ while (props[i].name != NULL && strcmp(props[i].name, property) != 0)
-+ i++;
+ int i;
++ _RuneLocale *rl;
+
+ i = 0;
+ while (props[i].name != NULL && strcmp(props[i].name, property) != 0)
+ i++;
+
+- return (props[i].mask);
++ if (props[i].mask)
++ return (props[i].mask);
+
-+ return (props[i].mask);
++ NORMALIZE_LOCALE(loc);
++ rl = &loc->__lc_ctype->_CurrentRuneLocale;
++ if ((i = rl->__ncharclasses) > 0) {
++ _RuneCharClass *rp;
++ for (rp = rl->__charclasses; i-- > 0; rp++) {
++ if (strncmp(rp->__name, property, CHARCLASS_NAME_MAX) == 0)
++ return (rp->__mask);
++ }
++ }
++ return 0;
+}
+
+wctype_t
-+wctype_l(const char *property, locale_t loc)
++wctype(const char *property)
+{
- int i;
-
- i = 0;
++ return wctype_l(property, __current_locale());
+ }