+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__.
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;
}
modules.so := $(addsuffix .so, $(modules))
-tests = bug-iconv1
+tests = bug-iconv1 bug-iconv2
include ../Makeconfig
--- /dev/null
+/* 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;
+}
{ \
/* 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. */ \
|| (inptr[1] == SS2_1 \
&& __builtin_expect (inptr + 3 > inend, 0))) \
{ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
if (inptr[1] == '$' \
\
if (__builtin_expect (ch, 1) == 0) \
{ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
else if (__builtin_expect (ch, 1) == __UNKNOWN_10646_CHAR) \
&& __builtin_expect (inptr + 3 >= inend, 0))) \
{ \
/* Not enough input available. */ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
\
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; \
\
if (__builtin_expect (ch, 1) == 0) \
{ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
&& __builtin_expect (inptr + 3 > inend, 0))))) \
\
{ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
if (inptr[1] == '$' && inptr[2] == ')' && inptr[3] == 'C') \
\
if (__builtin_expect (ch, 1) == 0) \
{ \
- result = __GCONV_EMPTY_INPUT; \
+ result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
[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",
ch = 0x203e; \
++inptr; \
} \
- else if (ch < 0x7e) \
+ else if (ch < 0x80) \
++inptr; \
else if (ch >= 0xa1 && ch <= 0xdf) \
{ \
+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
tr_TR ISO-8859-9
uk_UA KOI8-U
vi_VN UTF-8
+zh_CN GB2312
+zh_TW BIG5
END CHARMAP
WIDTH
-<U3000>..<U9F44> 2
+<U3000>...<U9F44> 2
END WIDTH
END CHARMAP
WIDTH
-<U4E02>..<UFA29> 2
+<U4E02>...<UFA29> 2
END WIDTH