This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: regression caused by fix of bug #13691


I wrote:
> I therefore propose to
>   - revert Tulio's "fix",
>   - remove vi_VN.TCVN/TCVN5712-1 from localedata/SUPPORTED, and
>   - resolve BZ #13691 as "Won't fix".
> 
> Patch attached.

Of course the unit test that exercises the vi_VN.TCVN locale also has to
be removed (otherwise it will fail). Revised patch attached.

>From 30b3dcbf1de76f7a2a2e7910da519e4c6967fd02 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Mon, 14 May 2012 01:35:15 +0200
Subject: [PATCH] [BZ #13691], Revert breakage of iconv() converter for TCVN-5712.

---
 ChangeLog               |   10 ++++++
 iconvdata/tcvn5712-1.c  |    5 +--
 localedata/SUPPORTED    |    1 -
 wcsmbs/Makefile         |    3 +-
 wcsmbs/tst-mbsnrtowcs.c |   83 -----------------------------------------------
 5 files changed, 13 insertions(+), 89 deletions(-)
 delete mode 100644 wcsmbs/tst-mbsnrtowcs.c

diff --git a/ChangeLog b/ChangeLog
index 6f0b685..487221d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-05-13  Bruno Haible  <bruno@clisp.org>
+
+	[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.
+	* localedata/SUPPORTED: Remove vi_VN.TCVN/TCVN5712-1.
+	* wcsmbs/tst-mbsnrtowcs.c: Remove file.
+	* wcsmbs/Makefile (tests): Remove tst-mbsnrtowcs.
+	(tst-mbsnrtowcs-ENV): Remove variable.
+
 2012-05-12  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* sysdeps/powerpc/memmove.c (MEMMOVE): Don't return a value if
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/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/wcsmbs/Makefile b/wcsmbs/Makefile
index c4d31d9..fc67be8 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -44,7 +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 \
+	 tst-c16c32-1 \
 	 wcsatcliff $(addprefix test-,$(strop-tests))
 
 include ../Rules
@@ -85,4 +85,3 @@ tst-mbrtowc-ENV = LOCPATH=$(common-objpfx)localedata
 tst-wcrtomb-ENV = LOCPATH=$(common-objpfx)localedata
 tst-mbrtowc2-ENV = LOCPATH=$(common-objpfx)localedata
 tst-c16c32-1-ENV = LOCPATH=$(common-objpfx)localedata
-tst-mbsnrtowcs-ENV = LOCPATH=$(common-objpfx)localedata
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 <tuliom@linux.vnet.ibm.com>,
-   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
-   <http://www.gnu.org/licenses/>.  */
-
-/* Test bugzilla 13691  */
-
-#include <stdio.h>
-#include <string.h>
-#include <wchar.h>
-#include <locale.h>
-
-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"
-- 
1.6.3.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]