]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 29 Aug 2000 21:14:05 +0000 (21:14 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 29 Aug 2000 21:14:05 +0000 (21:14 +0000)
2000-08-29  Akira Higuchi  <a@kondara.org>

* iconv/gconv_db.c (increment_counter): Reset __init_fct, __fct,
and __end_fct fields of struct __gconv_step.
* iconv/Makefile (tests): Add iconv-bug2.
* iconv/iconv-bug2.c: New file.

* iconvdata/euc-kr.c (BODY for FROM_LOOP): Pass 'inend - inptr'
instead of 'inptr - inend' to ksc5601_to_ucs4.

* iconvdata/sjis.c (BODY for FROM_LOOP): Allow 0x7f character.

* iconvdata/iso-2022-cn.c (BODY for FROM_LOOP): If an incomplete
character or shift sequence is found at the end of the input
string, return__GCONV_INCOMPLETE_INPUT instead of
__GCONV_EMPTY_INPUT.
* iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Likewise.
* iconvdata/iso-2022-kr.c (BODY for FROM_LOOP): Likewise.

* iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Return
__GCONV_ILLEGAL_INPUT for 8bit characters.

13 files changed:
ChangeLog
iconv/gconv_db.c
iconvdata/Makefile
iconvdata/bug-iconv2.c [new file with mode: 0644]
iconvdata/euc-kr.c
iconvdata/iso-2022-cn.c
iconvdata/iso-2022-jp.c
iconvdata/iso-2022-kr.c
iconvdata/sjis.c
localedata/ChangeLog
localedata/SUPPORTED
localedata/charmaps/GB2312
localedata/charmaps/GBK

index 9caad1f2a69b028b491d0ee3d5c42bd0563193e9..bef84db3fa9f78d20275717b47cf2b47380a1e38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2000-08-29  Akira Higuchi  <a@kondara.org>
+
+       * iconv/gconv_db.c (increment_counter): Reset __init_fct, __fct,
+       and __end_fct fields of struct __gconv_step.
+       * iconv/Makefile (tests): Add iconv-bug2.
+       * iconv/iconv-bug2.c: New file.
+
+       * iconvdata/euc-kr.c (BODY for FROM_LOOP): Pass 'inend - inptr'
+       instead of 'inptr - inend' to ksc5601_to_ucs4.
+
+       * iconvdata/sjis.c (BODY for FROM_LOOP): Allow 0x7f character.
+
+       * iconvdata/iso-2022-cn.c (BODY for FROM_LOOP): If an incomplete
+       character or shift sequence is found at the end of the input
+       string, return__GCONV_INCOMPLETE_INPUT instead of
+       __GCONV_EMPTY_INPUT.
+       * iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Likewise.
+       * iconvdata/iso-2022-kr.c (BODY for FROM_LOOP): Likewise.
+
+       * iconvdata/iso-2022-jp.c (BODY for FROM_LOOP): Return
+       __GCONV_ILLEGAL_INPUT for 8bit characters.
+
 2000-08-29  Ulrich Drepper  <drepper@redhat.com>
 
        * signal/signal.h (sigpause): Move __THROW before __asm__.
index 0caf310b910c95021a88eae9a222f9bf6b851707..50cedd62563bb52e96c9f0ffd9713723d0d20327 100644 (file)
@@ -305,6 +305,15 @@ increment_counter (struct __gconv_step *steps, size_t nsteps)
            result = __GCONV_NOCONV;
            break;
          }
+
+       steps[cnt].__init_fct = steps[cnt].__shlib_handle->init_fct;
+       steps[cnt].__fct = steps[cnt].__shlib_handle->fct;
+       steps[cnt].__end_fct = steps[cnt].__shlib_handle->end_fct;
+
+       if (steps[cnt].__end_fct != NULL)
+         DL_CALL_FCT (steps[cnt].__end_fct, &steps[cnt]);
+       if (steps[cnt].__init_fct != NULL)
+         DL_CALL_FCT (steps[cnt].__init_fct, &steps[cnt]);
       }
   return result;
 }
index 195a81ec8125c4858b5d8ed61fe1e2f23a8ef15a..b309d751f31dc82a0eec2be55bd91cc7e2be53b4 100644 (file)
@@ -49,7 +49,7 @@ modules       := ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5             \
 
 modules.so := $(addsuffix .so, $(modules))
 
-tests = bug-iconv1
+tests = bug-iconv1 bug-iconv2
 
 include ../Makeconfig
 
diff --git a/iconvdata/bug-iconv2.c b/iconvdata/bug-iconv2.c
new file mode 100644 (file)
index 0000000..a2bf44f
--- /dev/null
@@ -0,0 +1,47 @@
+/* Test case by Akira Higuchi <a@kondara.org>.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+  const char *dummy_codesets[] =
+  {
+    "ISO_8859-1", "ISO_8859-2", "ISO_8859-3", "ISO_8859-4",
+    "ISO_8859-5", "ISO_8859-6", "ISO_8859-7", "ISO_8859-8"
+  };
+  iconv_t dummy_cd[8], cd_a;
+  int i;
+  char buffer[1024], *to = buffer;
+  char *from = (char *) "foobar";
+  size_t to_left = 1024, from_left = 6;
+
+  /* load dummy modules */
+  for (i = 0; i < 8; i++)
+    if ((dummy_cd[i] = iconv_open (dummy_codesets[i], "UTF8")) == (iconv_t) -1)
+      exit (1);
+
+  /* load a module... */
+  if ((cd_a = iconv_open ("EUC-JP", "UTF8")) == (iconv_t) -1)
+    exit (1);
+  /* and close it once. we'll reload this later */
+  iconv_close (cd_a);
+
+  /* unload dummy modules */
+  for (i = 0; i < 8; i++)
+    iconv_close (dummy_cd[i]);
+
+  /* load the module again */
+  if ((cd_a = iconv_open ("EUC-JP", "UTF8")) == (iconv_t) -1)
+    exit (1);
+
+  puts ("This used to crash");
+  printf ("%d\n", iconv (cd_a, &from, &from_left, &to, &to_left));
+  iconv_close (cd_a);
+
+  puts ("works now");
+
+  return 0;
+}
index 786695801c318c5d8af4fa8f6d22a122a7683073..9ea937c005fd5bfd55486bae79666e4901929ac0 100644 (file)
@@ -99,7 +99,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
       {                                                                              \
        /* Two-byte character.  First test whether the next character         \
           is also available.  */                                             \
-       ch = ksc5601_to_ucs4 (&inptr, inptr - inend, 0x80);                   \
+       ch = ksc5601_to_ucs4 (&inptr, inend - inptr, 0x80);                   \
        if (__builtin_expect (ch, 1) == 0)                                    \
          {                                                                   \
            /* The second character is not available.  */                     \
index 6ffa18dc788ebba4ddc9d8d25e7a2f826ae932d0..d45ed6b30a0b00962cc2943e2e85108fbb9ca435 100644 (file)
@@ -151,7 +151,7 @@ enum
            || (inptr[1] == SS2_1                                             \
                && __builtin_expect (inptr + 3 > inend, 0)))                  \
          {                                                                   \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
        if (inptr[1] == '$'                                                   \
@@ -225,7 +225,7 @@ enum
                                                                              \
        if (__builtin_expect (ch, 1) == 0)                                    \
          {                                                                   \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
        else if (__builtin_expect (ch, 1) == __UNKNOWN_10646_CHAR)            \
index fc34aaba96097a0b7b5331b2aab934ac4cceceb0..bd2e033746620b1a5abda0382aa6358f5f34f0c9 100644 (file)
@@ -258,7 +258,7 @@ gconv_end (struct __gconv_step *data)
                && __builtin_expect (inptr + 3 >= inend, 0)))                 \
          {                                                                   \
            /* Not enough input available.  */                                \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
                                                                              \
@@ -399,6 +399,18 @@ gconv_end (struct __gconv_step *data)
            continue;                                                         \
          }                                                                   \
       }                                                                              \
+    else if (ch >= 0x80)                                                     \
+      {                                                                              \
+       if (! ignore_errors_p ())                                             \
+         {                                                                   \
+           result = __GCONV_ILLEGAL_INPUT;                                   \
+           break;                                                            \
+         }                                                                   \
+                                                                             \
+       ++inptr;                                                              \
+       ++*irreversible;                                                      \
+       continue;                                                             \
+      }                                                                              \
     else if (set == ASCII_set || (ch < 0x21 || ch == 0x7f))                  \
       /* Almost done, just advance the input pointer.  */                    \
       ++inptr;                                                               \
@@ -462,7 +474,7 @@ gconv_end (struct __gconv_step *data)
                                                                              \
        if (__builtin_expect (ch, 1) == 0)                                    \
          {                                                                   \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
        else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR)            \
index 56e17a2f962b5489d5b32605dfafeff6bc4b2571..c0280fcceab6bfa435ac6612c4c89783bcbb8eb7 100644 (file)
@@ -149,7 +149,7 @@ enum
                        && __builtin_expect (inptr + 3 > inend, 0)))))        \
                                                                              \
          {                                                                   \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
        if (inptr[1] == '$' && inptr[2] == ')' && inptr[3] == 'C')            \
@@ -188,7 +188,7 @@ enum
                                                                              \
        if (__builtin_expect (ch, 1) == 0)                                    \
          {                                                                   \
-           result = __GCONV_EMPTY_INPUT;                                     \
+           result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
        else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR)            \
index 244cec6db4e3bcaecf954cb31ac8d7ce81016b19..7bbfef3e5dfd4784be725acd43195ff5e0d536d5 100644 (file)
@@ -1941,7 +1941,7 @@ static const char from_ucs4_lat1[0xf8][2] =
   [0x0075] = "\x75\x00", [0x0076] = "\x76\x00", [0x0077] = "\x77\x00",
   [0x0078] = "\x78\x00", [0x0079] = "\x79\x00", [0x007a] = "\x7a\x00",
   [0x007b] = "\x7b\x00", [0x007c] = "\x7c\x00", [0x007d] = "\x7d\x00",
-  [0x007e] = "\x7e\x00",
+  [0x007e] = "\x7e\x00", [0x007f] = "\x7f\x00",
   [0x00a2] = "\x81\x91", [0x00a3] = "\x81\x92", [0x00a5] = "\x5c\x00",
   [0x00a7] = "\x81\x98", [0x00a8] = "\x81\x4e", [0x00ac] = "\x81\xca",
   [0x00b0] = "\x81\x8b", [0x00b1] = "\x81\x7d", [0x00b4] = "\x81\x4c",
@@ -4353,7 +4353,7 @@ static const char from_ucs4_extra[0x100][2] =
        ch = 0x203e;                                                          \
        ++inptr;                                                              \
       }                                                                              \
-    else if (ch < 0x7e)                                                              \
+    else if (ch < 0x80)                                                              \
       ++inptr;                                                               \
     else if (ch >= 0xa1 && ch <= 0xdf)                                       \
       {                                                                              \
index 559d0015287f241262d006638d4e0accc0217745..4987943264714a2b80a8239b35308f8057f873d1 100644 (file)
@@ -1,3 +1,10 @@
+2000-08-29  Akira Higuchi  <a@kondara.org>
+
+       * charmaps/GB2312: Fix ".." -> "..." in width definitions.
+       * charmaps/GBK: Likewise.
+
+       * SUPPORTED: Add zh_CN.GB2312 and zh_TW.BIG5.
+
 2000-08-27  Ulrich Drepper  <drepper@redhat.com>
 
        * locales/sv_SE: Remove old LC_COLLATE definition.  Use iso14651_t1
index 8522572e92fe2b586aeb110752343498460d8e8c..ae2a0d4db9163dec8f4583e6e8cae7233af5a4da 100644 (file)
@@ -127,3 +127,5 @@ th_TH TIS-620
 tr_TR ISO-8859-9
 uk_UA KOI8-U
 vi_VN UTF-8
+zh_CN GB2312
+zh_TW BIG5
index 3dd7b481b9c05579eb96c1da33b4089f744a3be5..30d94effeed85156c05556be72f8c7c85a993ca7 100644 (file)
@@ -7634,5 +7634,5 @@ CHARMAP
 END CHARMAP
 
 WIDTH
-<U3000>..<U9F44> 2
+<U3000>...<U9F44> 2
 END WIDTH
index 7c8b3bfab26a5af1bfcbddf85a09d6701c75f392..de48a44183a16484d5ed70010e0e49f1e85f7d29 100644 (file)
@@ -21929,5 +21929,5 @@ CHARMAP
 END CHARMAP
 
 WIDTH
-<U4E02>..<UFA29> 2
+<U4E02>...<UFA29> 2
 END WIDTH