From 0e16ecfa1e7689c0b3be626f9a3441ebb5710c70 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 28 Jun 2000 04:27:24 +0000 Subject: Update. * locale/programs/ld-ctype.c (ctype_finish): Take all characters from the input charset into account when generating the hash table. (allocate_arrays): Correct setting default width. Not all empty slots in the table are filled, only those not covert explicitly by the locale description and in the charset. * stdio-common/vfscanf.c: Make sure to always return WEOF and EOF for wide character version. For %C handling, test correct pointer variable for NULL. * wcsmbs/wctob.c: Handle WEOF special. * wcsmbs/wcwidth.h: 0xff in width array means invalid character. * wctype/wctype.h: Protect gcc-isms with __extension__. Avoid always-true test to avoid warning. --- localedata/tests-mbwc/dat_wcswidth.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'localedata/tests-mbwc/dat_wcswidth.c') diff --git a/localedata/tests-mbwc/dat_wcswidth.c b/localedata/tests-mbwc/dat_wcswidth.c index f8d51341d7..a1c7076e60 100644 --- a/localedata/tests-mbwc/dat_wcswidth.c +++ b/localedata/tests-mbwc/dat_wcswidth.c @@ -64,10 +64,10 @@ TST_WCSWIDTH tst_wcswidth_loc [] = { { /*input.*/ { { 0x00C1,0x00FF,0x0000 }, 2 }, /* 18 */ /*expect*/ { 0,0,1,2 }, }, - { /*input.*/ { { 0x00C1,0x3042,0x0000 }, 2 }, /* 19 */ /* */ /* returns 2 */ + { /*input.*/ { { 0x00C1,0x3042,0x0000 }, 2 }, /* 19 */ /*expect*/ { 0,0,1,-1 }, }, - { /*input.*/ { { 0x00C1,0x3044,0x0000 }, 2 }, /* 20 */ /* */ /* returns 2 */ + { /*input.*/ { { 0x00C1,0x3044,0x0000 }, 2 }, /* 20 */ /*expect*/ { 0,0,1,-1 }, }, { is_last: 1 } @@ -85,12 +85,21 @@ TST_WCSWIDTH tst_wcswidth_loc [] = { { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 2 }, /* 03 */ /*expect*/ { 0,0,1,2 }, }, +#ifdef SHOJI_IS_RIGHT { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 3 }, /* 04 */ /*expect*/ { 0,0,1,3 }, }, { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 4 }, /* 05 */ /*expect*/ { 0,0,1,3 }, }, +#else + { /*input.*/ { { 0x0041,0x0042,0x00C3,0x0000 }, 3 }, /* 04 */ + /*expect*/ { 0,0,1,-1 }, + }, + { /*input.*/ { { 0x0041,0x0042,0x0043,0x0000 }, 4 }, /* 05 */ + /*expect*/ { 0,0,1,3 }, + }, +#endif { /*input.*/ { { 0x0000 }, 1 }, /* 06 */ /*expect*/ { 0,0,1,0 }, }, @@ -124,17 +133,24 @@ TST_WCSWIDTH tst_wcswidth_loc [] = { { /*input.*/ { { 0x0041,0x00A0,0x0000 }, 2 }, /* 16 */ /*expect*/ { 0,0,1,-1 }, }, +#ifdef SHOJI_IS_RIGHT { /*input.*/ { { 0x0041,0x00A1,0x0000 }, 2 }, /* 17 */ /*expect*/ { 0,0,1,2 }, }, { /*input.*/ { { 0x0041,0x00FF,0x0000 }, 2 }, /* 18 */ /*expect*/ { 0,0,1,2 }, }, - /* */ /* returns 2 */ +#else + { /*input.*/ { { 0x0041,0x007E,0x0000 }, 2 }, /* 17 */ + /*expect*/ { 0,0,1,2 }, + }, + { /*input.*/ { { 0x0041,0x0020,0x0000 }, 2 }, /* 18 */ + /*expect*/ { 0,0,1,2 }, + }, +#endif { /*input.*/ { { 0x0041,0x3042,0x0000 }, 2 }, /* 19 */ /*expect*/ { 0,0,1,-1 }, }, - /* */ /* returns 2 */ { /*input.*/ { { 0x0041,0x3044,0x0000 }, 2 }, /* 20 */ /*expect*/ { 0,0,1,-1 }, }, @@ -192,10 +208,17 @@ TST_WCSWIDTH tst_wcswidth_loc [] = { { /*input.*/ { { 0x0041,0x00A0,0x0000 }, 2 }, /* 16 */ /*expect*/ { 0,0,1,-1 }, }, +#ifdef NO_WAIVER /* */ /* returns 3 */ { /*input.*/ { { 0x0041,0x00A1,0x0000 }, 2 }, /* 17 */ /*expect*/ { 0,0,1,-1 }, }, +#else + /* XXX U00A1 is valid -> /x8f/xa2/xc4 in JIS X 0212 */ + { /*input.*/ { { 0x0041,0x00A1,0x0000 }, 2 }, /* 17 */ + /*expect*/ { 0,0,1,3 }, + }, +#endif { /*input.*/ { { 0x0041,0xFF71,0x0000 }, 2 }, /* 18 */ /*expect*/ { 0,0,1,2 }, }, -- cgit v1.2.3