The regression test in regress/lib/libc/locale/check_isw doesn't pass
in current.
My thinking for the attached patch is that since this test is
intended only for the POSIX locale, it should only test the portable
character set and the control characters set.
http://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html
http://pubs.opengroup.org/onlinepubs/7908799/xbd/charset.html#tagt_1
--
Dios, gracias por tu amor infinito.
--
Vladimir Támara Patiño. http://vtamara.pasosdeJesus.org/
http://www.pasosdejesus.org/dominio_publico_colombia.html
Index: check_isw.c
===================================================================
RCS file: /cvs/src/regress/lib/libc/locale/check_isw/check_isw.c,v
retrieving revision 1.1
diff -u -r1.1 check_isw.c
--- check_isw.c 11 Aug 2005 21:57:02 -0000 1.1
+++ check_isw.c 19 Mar 2013 11:30:40 -0000
@@ -50,7 +50,7 @@
{
int i;
- for (i = 0; i < 256; i++) {
+ for (i = 0; i < 128; i++) {
printf(" %02x: ", i);
check_bool(isalnum(i), iswalnum(i), '1');
check_bool(isalpha(i), iswalpha(i), '2');
@@ -82,7 +82,7 @@
wchar_t c, d;
mbstate_t state;
- s = malloc(256);
+ s = malloc(128);
if (!s) {
bad++;
return;
@@ -93,14 +93,14 @@
free(s);
return;
}
- for (i = 0; i < 256; i++)
+ for (i = 0; i < 127; i++)
s[i] = i+1;
j = 0;
mbrtowc(NULL, NULL, 1, &state);
printf(" %02x: ", 0);
- while ((n = mbrtowc(&c, s+j, 256-j, &state)) == 1) {
+ while (j < 127 && (n = mbrtowc(&c, s+j, 128-j, &state)) == 1) {
printf(" %02x: ", s[j]);
check_bool(isalnum(s[j]), iswalnum(c), '1');
check_bool(isalpha(s[j]), iswalpha(c), '2');
@@ -130,7 +130,7 @@
printf("\n");
j++;
}
- if (n != 0 || j != 255) {
+ if (n != 1 || j != 127) {
bad++;
}
free(s);