svn commit: branches/uClibc_0_9_30: libc/misc/wchar test/locale-mbwc

carmelo at uclibc.org carmelo at uclibc.org
Tue Dec 2 17:15:35 UTC 2008


Author: carmelo
Date: 2008-12-02 09:15:35 -0800 (Tue, 02 Dec 2008)
New Revision: 24232

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_0_9_30/libc/misc/wchar/wchar.c
   branches/uClibc_0_9_30/test/locale-mbwc/dat_iswctype.c


Changeset:
Modified: branches/uClibc_0_9_30/libc/misc/wchar/wchar.c
===================================================================
--- branches/uClibc_0_9_30/libc/misc/wchar/wchar.c	2008-12-02 17:14:47 UTC (rev 24231)
+++ branches/uClibc_0_9_30/libc/misc/wchar/wchar.c	2008-12-02 17:15:35 UTC (rev 24232)
@@ -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_0_9_30/test/locale-mbwc/dat_iswctype.c
===================================================================
--- branches/uClibc_0_9_30/test/locale-mbwc/dat_iswctype.c	2008-12-02 17:14:47 UTC (rev 24231)
+++ branches/uClibc_0_9_30/test/locale-mbwc/dat_iswctype.c	2008-12-02 17:15:35 UTC (rev 24232)
@@ -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