svn commit: branches/uClibc-nptl: libc/misc/wchar test/locale-mbwc
carmelo at uclibc.org
carmelo at uclibc.org
Tue Dec 2 17:14:37 UTC 2008
Author: carmelo
Date: 2008-12-02 09:14:36 -0800 (Tue, 02 Dec 2008)
New Revision: 24230
Log:
Fix wcswidth function when LOCALE support is disabled
while keeping WCHAR support enabled. This solves two
testcases: tst_wcwidth and tst_wcswidth.
Fix dat_iswctype.c fiinput file: character 0x80 is not
a control character: it fixes tst_iswctype test.
Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono at st.com>
Modified:
branches/uClibc-nptl/libc/misc/wchar/wchar.c
branches/uClibc-nptl/test/locale-mbwc/dat_iswctype.c
Changeset:
Modified: branches/uClibc-nptl/libc/misc/wchar/wchar.c
===================================================================
--- branches/uClibc-nptl/libc/misc/wchar/wchar.c 2008-12-02 14:46:38 UTC (rev 24229)
+++ branches/uClibc-nptl/libc/misc/wchar/wchar.c 2008-12-02 17:14:36 UTC (rev 24230)
@@ -1143,7 +1143,14 @@
{
int count;
wchar_t wc;
+ size_t i;
+ for (i = 0 ; (i < n) && pwcs[i] ; i++) {
+ if (pwcs[i] != (pwcs[i] & 0x7f)) {
+ return -1;
+ }
+ }
+
for (count = 0 ; n && (wc = *pwcs++) ; n--) {
if (wc <= 0xff) {
/* If we're here, wc != 0. */
Modified: branches/uClibc-nptl/test/locale-mbwc/dat_iswctype.c
===================================================================
--- branches/uClibc-nptl/test/locale-mbwc/dat_iswctype.c 2008-12-02 14:46:38 UTC (rev 24229)
+++ branches/uClibc-nptl/test/locale-mbwc/dat_iswctype.c 2008-12-02 17:14:36 UTC (rev 24230)
@@ -240,7 +240,7 @@
{ { 0x007B, "cntrl" }, { 0,1,0 } },
{ { 0x007E, "cntrl" }, { 0,1,0 } },
{ { 0x007F, "cntrl" }, { 0,0,0 } },
- { { 0x0080, "cntrl" }, { 0,0,0 } },
+ { { 0x0080, "cntrl" }, { 0,1,0 } },
{ { 0x0000, "digit" }, { 0,1,0 } },
{ { 0x001F, "digit" }, { 0,1,0 } },
{ { 0x0020, "digit" }, { 0,1,0 } },
More information about the uClibc-cvs
mailing list