aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs/wcwidth.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-01 18:59:42 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-01 18:59:42 +0000
commit4a9dcff10ec07770aaf0b4dedaac44eacbbaa110 (patch)
treeab9c931b7f57f4ef5e82dc2260717b621f3650ff /wcsmbs/wcwidth.h
parent70440f48d8c4aa57f030485b60a7faf686f1dd4d (diff)
downloadglibc-4a9dcff10ec07770aaf0b4dedaac44eacbbaa110.zip
glibc-4a9dcff10ec07770aaf0b4dedaac44eacbbaa110.tar.gz
glibc-4a9dcff10ec07770aaf0b4dedaac44eacbbaa110.tar.bz2
Update.
* charmaps/ISO-IR-197: Remove alias "none". 2000-09-30 Bruno Haible <haible@clisp.cons.org>
Diffstat (limited to 'wcsmbs/wcwidth.h')
-rw-r--r--wcsmbs/wcwidth.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/wcsmbs/wcwidth.h b/wcsmbs/wcwidth.h
index d13a5f5..49ad7c0 100644
--- a/wcsmbs/wcwidth.h
+++ b/wcsmbs/wcwidth.h
@@ -22,9 +22,6 @@
#include <wctype.h>
#include "../wctype/wchar-lookup.h"
-/* Tables containing character property information. */
-extern const char *__ctype32_wctype[12];
-
/* Table containing width information. */
extern const char *__ctype32_width;
@@ -33,12 +30,10 @@ internal_wcwidth (wint_t wc)
{
unsigned char res;
- if (wc == L'\0')
- return 0;
-
- if (wctype_table_lookup (__ctype32_wctype[__ISwprint], wc) == 0)
- return -1;
-
+ /* The tables have been prepared in such a way that
+ 1. wc == L'\0' yields res = 0,
+ 2. !iswprint (wc) implies res = '\xff'. */
res = wcwidth_table_lookup (__ctype32_width, wc);
+
return res == (unsigned char) '\xff' ? -1 : (int) res;
}