From 5fefb43629b36b143c9ac100b89408a2cbeed3a8 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 21 May 2012 20:41:36 +0200 Subject: [PATCH] [BZ #13691], Revert breakage of iconv() converter for TCVN-5712. * iconvdata/tcvn5712-1.c (BODY for FROM_LOOP): Don't consider inptr and inend for must_buffer_ch. * wcsmbs/tst-mbsnrtowcs.c: Remove file. * wcsmbs/Makefile (tests): Remove tst-mbsnrtowcs. * stdio-common/Makefile (tests): Remove bug15. (bug15-ENV): Remove macro. * stdio-common/bug15.c: Remove, we do not support vi_VN.TCVN5712-1 anymore. localedata: * SUPPORTED: Remove vi_VN.TCVN/TCVN5712-1. * tst-strptime.c: Remove, we do not support vi_VN.TCVN5712-1 anymore. * Makefile (LOCALES): Remove vi_VN.TCVN5712-1 from list. (tests): Remove tst-strptime. --- ChangeLog | 13 ++++++++ iconvdata/tcvn5712-1.c | 5 ++- localedata/ChangeLog | 9 +++++ localedata/Makefile | 8 ++--- localedata/SUPPORTED | 1 - localedata/tst-strptime.c | 54 ------------------------------ stdio-common/Makefile | 3 +- stdio-common/bug15.c | 10 ------ wcsmbs/Makefile | 3 +- wcsmbs/tst-mbsnrtowcs.c | 83 ----------------------------------------------- 10 files changed, 30 insertions(+), 159 deletions(-) delete mode 100644 localedata/tst-strptime.c delete mode 100644 stdio-common/bug15.c delete mode 100644 wcsmbs/tst-mbsnrtowcs.c diff --git a/ChangeLog b/ChangeLog index 5ffb2f7..014786f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2012-05-21 Bruno Haible + Andreas Jaeger + + [BZ #13691], Revert breakage of iconv() converter for TCVN-5712. + * iconvdata/tcvn5712-1.c (BODY for FROM_LOOP): Don't consider + inptr and inend for must_buffer_ch. + * wcsmbs/tst-mbsnrtowcs.c: Remove file. + * wcsmbs/Makefile (tests): Remove tst-mbsnrtowcs. + * stdio-common/Makefile (tests): Remove bug15. + (bug15-ENV): Remove macro. + * stdio-common/bug15.c: Remove, we do not support vi_VN.TCVN5712-1 + anymore. + 2012-05-19 Andreas Jaeger Roland McGrath diff --git a/iconvdata/tcvn5712-1.c b/iconvdata/tcvn5712-1.c index 90c8610..f6a0c4f 100644 --- a/iconvdata/tcvn5712-1.c +++ b/iconvdata/tcvn5712-1.c @@ -378,9 +378,8 @@ static const struct /* Determine whether there is a buffered character pending. */ \ last_ch = *statep >> 3; \ \ - /* We have to buffer ch if it is a possible match in comp_table_data \ - and if it isn't the last char of the string. */ \ - must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0) && (inptr + 1 != inend); \ + /* We have to buffer ch if it is a possible match in comp_table_data. */ \ + must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0); \ \ if (last_ch) \ { \ diff --git a/localedata/ChangeLog b/localedata/ChangeLog index 6ef7dc7..2fdd858 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,12 @@ +2012-05-21 Bruno Haible + Andreas Jaeger + + * SUPPORTED: Remove vi_VN.TCVN/TCVN5712-1. + * tst-strptime.c: Remove, we do not support vi_VN.TCVN5712-1 + anymore. + * Makefile (LOCALES): Remove vi_VN.TCVN5712-1 from list. + (tests): Remove tst-strptime. + 2012-05-11 Andreas Schwab [BZ #11837] diff --git a/localedata/Makefile b/localedata/Makefile index 1318960..0873a55 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -78,7 +78,7 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \ tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ - tst-strfmon1 tst-sscanf tst-strptime bug-setlocale1 tst-setlocale2 + tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 ifeq (yes,$(build-shared)) ifneq (no,$(PERL)) tests: $(objpfx)mtrace-tst-leaks @@ -119,9 +119,9 @@ ifeq (no,$(cross-compiling)) LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \ en_US.ISO-8859-1 ja_JP.EUC-JP da_DK.ISO-8859-1 \ hr_HR.ISO-8859-2 sv_SE.ISO-8859-1 ja_JP.SJIS fr_FR.ISO-8859-1 \ - vi_VN.TCVN5712-1 nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 \ - tr_TR.UTF-8 cs_CZ.UTF-8 zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 \ - ja_JP.UTF-8 si_LK.UTF-8 tr_TR.ISO-8859-9 + nb_NO.ISO-8859-1 nn_NO.ISO-8859-1 tr_TR.UTF-8 cs_CZ.UTF-8 \ + zh_TW.EUC-TW fa_IR.UTF-8 fr_FR.UTF-8 ja_JP.UTF-8 si_LK.UTF-8 \ + tr_TR.ISO-8859-9 LOCALE_SRCS := $(shell echo "$(LOCALES)"|sed 's/\([^ .]*\)[^ ]*/\1/g') CHARMAPS := $(shell echo "$(LOCALES)" | \ sed -e 's/[^ .]*[.]\([^ ]*\)/\1/g' -e s/SJIS/SHIFT_JIS/g) diff --git a/localedata/SUPPORTED b/localedata/SUPPORTED index 1fd7847..b33d5b8 100644 --- a/localedata/SUPPORTED +++ b/localedata/SUPPORTED @@ -409,7 +409,6 @@ ur_PK/UTF-8 \ uz_UZ/ISO-8859-1 \ uz_UZ@cyrillic/UTF-8 \ ve_ZA/UTF-8 \ -vi_VN.TCVN/TCVN5712-1 \ vi_VN/UTF-8 \ wa_BE/ISO-8859-1 \ wa_BE@euro/ISO-8859-15 \ diff --git a/localedata/tst-strptime.c b/localedata/tst-strptime.c deleted file mode 100644 index bc2c7f1..0000000 --- a/localedata/tst-strptime.c +++ /dev/null @@ -1,54 +0,0 @@ -#include -#include -#include -#include - -static int -do_test (void) -{ - int result = 0; - - if (setlocale (LC_ALL, "vi_VN.TCVN5712-1") == NULL) - { - puts ("cannot set locale"); - return 1; - } - struct tm tm; - memset (&tm, '\0', sizeof (tm)); - /* This is November in Vietnamese encoded using TCVN5712-1. */ - static const char s[] = "\ -\x54\x68\xb8\x6e\x67\x20\x6d\xad\xea\x69\x20\x6d\xe9\x74\0"; - char *r = strptime (s, "%b", &tm); - printf ("r = %p, r-s = %tu, tm.tm_mon = %d\n", r, r - s, tm.tm_mon); - result = r == NULL || r - s != 14 || tm.tm_mon != 10; - - if (setlocale (LC_ALL, "ja_JP.UTF-8") == NULL) - { - puts ("cannot set locale"); - return 1; - } - static const char s2[] = "\ -\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\0"; - memset (&tm, '\0', sizeof (tm)); - r = strptime (s2, "%d %m %EC%Ey", &tm); - printf ("\ -r = %p, r-s2 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n", - r, r - s2, tm.tm_mday, tm.tm_mon, tm.tm_year); - result |= (r == NULL || r - s2 != 14 || tm.tm_mday != 25 || tm.tm_mon != 5 - || tm.tm_year != 108); - - static const char s3[] = "\ -\x32\x35\x20\x30\x36\x20\xe5\xb9\xb3\xe6\x88\x90\x32\x30\xe5\xb9\xb4\0"; - memset (&tm, '\0', sizeof (tm)); - r = strptime (s3, "%d %m %EY", &tm); - printf ("\ -r = %p, r-s3 = %tu, tm.tm_mday = %d, tm.tm_mon = %d, tm.tm_year = %d\n", - r, r - s3, tm.tm_mday, tm.tm_mon, tm.tm_year); - result |= (r == NULL || r - s3 != 17 || tm.tm_mday != 25 || tm.tm_mon != 5 - || tm.tm_year != 108); - - return result; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/stdio-common/Makefile b/stdio-common/Makefile index 7519bc1..02684d2 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -51,7 +51,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \ scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \ tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \ - tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 bug15 \ + tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \ tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \ bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ @@ -120,7 +120,6 @@ tst-swprintf-ENV = LOCPATH=$(common-objpfx)localedata test-vfprintf-ENV = LOCPATH=$(common-objpfx)localedata scanf13-ENV = LOCPATH=$(common-objpfx)localedata bug14-ENV = LOCPATH=$(common-objpfx)localedata -bug15-ENV = LOCPATH=$(common-objpfx)localedata tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata ifneq (,$(filter %REENTRANT, $(defines))) diff --git a/stdio-common/bug15.c b/stdio-common/bug15.c deleted file mode 100644 index 825ca2f..0000000 --- a/stdio-common/bug15.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int -main (void) -{ - char buf[10]; - setlocale (LC_ALL, "vi_VN.TCVN-5712"); - return sprintf (buf, "%.*s", 2, "vi") != 2; -} diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index c4d31d9..99d3d28 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -44,8 +44,7 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ strop-tests := wcscmp wmemcmp wcslen wcschr wcsrchr wcscpy tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \ tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \ - tst-c16c32-1 tst-mbsnrtowcs \ - wcsatcliff $(addprefix test-,$(strop-tests)) + tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests)) include ../Rules diff --git a/wcsmbs/tst-mbsnrtowcs.c b/wcsmbs/tst-mbsnrtowcs.c deleted file mode 100644 index 29ff7c2..0000000 --- a/wcsmbs/tst-mbsnrtowcs.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (C) 2012 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Tulio Magno Quites Machado Filho , - 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -/* Test bugzilla 13691 */ - -#include -#include -#include -#include - -static int -do_test (void) -{ - const char * in = "A"; - const char *inbuf = in; - size_t inlen = strchr (in, '\0') - inbuf; - - wchar_t out[5]; - mbstate_t ps; - - const char *locale = "vi_VN.TCVN5712-1"; - if (!setlocale (LC_ALL, locale)) - { - printf ("Locale not available.\n"); - return 1; - } - - memset (&ps, '\0', sizeof (ps)); - memset (out, '\0', sizeof (out)); - - /* If the bug isn't fixed, it isn't going to return from mbsnrtowcs due to - an assert(). */ - size_t n = mbsnrtowcs (out, &inbuf, inlen, sizeof(out) - 1, &ps); - - int result = 0; - - if (n != 1) - { - printf ("n = %zu, expected 1\n", n); - result = 1; - } - - int i; - printf ("in = "); - for (i = 0; i < inlen; i++) - { - printf ("0x%X ", in[i]); - } - printf ("\n"); - - char * outb = (char *) out; - printf ("out ="); - for (i = 0; i < sizeof (out); i++) - { - if (i % 4 == 0) - { - printf (" 0x"); - } - printf ("%X", outb[i]); - } - printf ("\n"); - - return result; -} - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" -- 2.7.4