summaryrefslogtreecommitdiff
path: root/src/ctype/iswalpha.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctype/iswalpha.c')
-rw-r--r--src/ctype/iswalpha.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ctype/iswalpha.c b/src/ctype/iswalpha.c
index 0f031eac..4007c8a6 100644
--- a/src/ctype/iswalpha.c
+++ b/src/ctype/iswalpha.c
@@ -1,6 +1,14 @@
#include <wctype.h>
+static unsigned char table[] = {
+#include "alpha.h"
+};
+
int iswalpha(wint_t wc)
{
- return (32U|wc)-'a'<26;
+ if (wc<0x20000U)
+ return (table[table[wc>>8]*32+((wc&255)>>3)]>>(wc&7))&1;
+ if (wc<0x2fffeU)
+ return 1;
+ return 0;
}