aboutsummaryrefslogtreecommitdiff
path: root/iconvdata
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-20 02:05:39 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-20 02:05:39 +0000
commite2806aaf5d84e7eb63cc11633e9e833d8d1421b5 (patch)
treee0a2a4cc43c8d9e955724fe2e2823e4f76623085 /iconvdata
parent602c2f9d9d4995ecab62f2ee22c1a09741e6b1a5 (diff)
downloadglibc-e2806aaf5d84e7eb63cc11633e9e833d8d1421b5.zip
glibc-e2806aaf5d84e7eb63cc11633e9e833d8d1421b5.tar.gz
glibc-e2806aaf5d84e7eb63cc11633e9e833d8d1421b5.tar.bz2
Update.
2002-04-15 Bruno Haible <bruno@clisp.org> * iconvdata/sjis.c (halfkana_to_ucs4): Remove array. (BODY for FROM_LOOP): Optimize the JISX0201:GR to Unicode conversion. 2002-04-15 Bruno Haible <bruno@clisp.org> * iconvdata/euc-jp.c (BODY for FROM_LOOP): When encountering an invalid input (e.g. a byte > 0x80 followed by a byte < 0x80), skip always one byte, not 0 bytes in some cases and 2 bytes in others. * iconvdata/tst-table-from.c (main): Correct the usage message. 2002-04-19 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regcomp.c (parse_expression): Fix incorrect error code. (parse_dup_op): Fix error handling like "a{}". (parse_bracket_exp): Add error handling. (fetch_number): Add error handling for "a{<very_large_number>}". 2002-04-19 Isamu Hasegawa <isamu@yamato.ibm.com> * posix/regcomp.c (parse_bracket_symbol): Add error handling in case that the symbol name is too long. (build_charclass): Handle [:lower:]/[:uppper:] correctly in case of REG_ICASE.
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/euc-jp.c10
-rw-r--r--iconvdata/sjis.c20
-rw-r--r--iconvdata/tst-table-from.c4
3 files changed, 13 insertions, 21 deletions
diff --git a/iconvdata/euc-jp.c b/iconvdata/euc-jp.c
index 1a63899..3c55e44 100644
--- a/iconvdata/euc-jp.c
+++ b/iconvdata/euc-jp.c
@@ -63,12 +63,12 @@
else \
{ \
/* Two or more byte character. First test whether the next \
- character is also available. */ \
+ byte is also available. */ \
int ch2; \
\
if (__builtin_expect (inptr + 1 >= inend, 0)) \
{ \
- /* The second character is not available. Store the \
+ /* The second byte is not available. Store the \
intermediate result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -104,6 +104,10 @@
result = __GCONV_ILLEGAL_INPUT; \
break; \
} \
+ \
+ ++inptr; \
+ ++*irreversible; \
+ continue; \
} \
\
inptr += 2; \
@@ -143,7 +147,7 @@
break; \
} \
\
- inptr += 2; \
+ ++inptr; \
++*irreversible; \
continue; \
} \
diff --git a/iconvdata/sjis.c b/iconvdata/sjis.c
index 3a19642..6f53646 100644
--- a/iconvdata/sjis.c
+++ b/iconvdata/sjis.c
@@ -1,5 +1,5 @@
/* Mapping tables for SJIS handling.
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997-2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -22,18 +22,6 @@
#include <stdint.h>
#include <wchar.h>
-static const uint32_t halfkana_to_ucs4[] =
-{
- 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67, 0xff68,
- 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f, 0xff70,
- 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77, 0xff78,
- 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f, 0xff80,
- 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87, 0xff88,
- 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f, 0xff90,
- 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97, 0xff98,
- 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f
-};
-
/* The following table can be generated from the file
unix/mappings/eastasia/jis/shiftjis.txt
@@ -4357,7 +4345,7 @@ static const char from_ucs4_extra[0x100][2] =
++inptr; \
else if (ch >= 0xa1 && ch <= 0xdf) \
{ \
- ch = halfkana_to_ucs4[ch - 0xa1]; \
+ ch += 0xfec0; \
++inptr; \
} \
else if (__builtin_expect (ch > 0xea, 0) \
@@ -4378,14 +4366,14 @@ static const char from_ucs4_extra[0x100][2] =
} \
else \
{ \
- /* Two-byte character. First test whether the next character \
+ /* Two-byte character. First test whether the next byte \
is also available. */ \
uint32_t ch2; \
uint_fast32_t idx; \
\
if (__builtin_expect (inptr + 1 >= inend, 0)) \
{ \
- /* The second character is not available. Store \
+ /* The second byte is not available. Store \
the intermediate result. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
diff --git a/iconvdata/tst-table-from.c b/iconvdata/tst-table-from.c
index 9bf0ba3..084de5f 100644
--- a/iconvdata/tst-table-from.c
+++ b/iconvdata/tst-table-from.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
@@ -184,7 +184,7 @@ main (int argc, char *argv[])
if (argc != 2)
{
- fprintf (stderr, "Usage: tst-table-to charset\n");
+ fprintf (stderr, "Usage: tst-table-from charset\n");
exit (1);
}
charset = argv[1];