about summary refs log tree commit diff
path: root/iconvdata/euc-tw.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-05 02:41:25 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-05 02:41:25 +0000
commitb79f74cd622578ce5eea1a3ed5840ac53d6b6d93 (patch)
tree2c0e56654a4df00616e8994f181434ddf3246549 /iconvdata/euc-tw.c
parentbcf6d602849db60d9651ffade87f18282c75ebd4 (diff)
downloadglibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.tar.gz
glibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.tar.xz
glibc-b79f74cd622578ce5eea1a3ed5840ac53d6b6d93.zip
Update.
2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/EUC-TW: Add commented non-reversible mappings.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/CP949: New file.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/GB2312: Remove 0x80..0xA0, 0xAA..0xAF, 0xF8..FF.

2000-09-03  Bruno Haible  <haible@clisp.cons.org>

	* charmaps/EUC-JP: Nonreversibly map 0xA1C0 to U+005C and 0x8FA2B7 to
	U+007E.
Diffstat (limited to 'iconvdata/euc-tw.c')
-rw-r--r--iconvdata/euc-tw.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/iconvdata/euc-tw.c b/iconvdata/euc-tw.c
index ed7a197d7c..39c2f1f7da 100644
--- a/iconvdata/euc-tw.c
+++ b/iconvdata/euc-tw.c
@@ -65,7 +65,7 @@
 	   character is also available.  */				      \
 	uint32_t ch2;							      \
 									      \
-	if (inptr + (ch == 0x8e ? 3 : 1) >= inend)			      \
+	if (inptr + 1 >= inend)						      \
 	  {								      \
 	    /* The second character is not available.  Store the	      \
 	       intermediate result.  */					      \
@@ -73,7 +73,7 @@
 	    break;							      \
 	  }								      \
 									      \
-	ch2 = *inptr;							      \
+	ch2 = *(inptr + 1);						      \
 									      \
 	/* All second bytes of a multibyte character must be >= 0xa1. */      \
 	if (ch2 < 0xa1 || ch2 == 0xff)					      \
@@ -96,8 +96,15 @@
 	    const char *endp = inptr + 1;				      \
 									      \
 	    ch = cns11643_to_ucs4 (&endp, inend - inptr - 1, 0x80);	      \
-	    /* Please note that we need not test for the missing input	      \
-	       characters here anymore.  */				      \
+									      \
+	    if (ch == 0)						      \
+	      {								      \
+		/* The third or fourth character is not available.  Store     \
+		   the intermediate result.  */				      \
+		result = __GCONV_INCOMPLETE_INPUT;			      \
+		break;							      \
+	      }								      \
+									      \
 	    if (ch == __UNKNOWN_10646_CHAR)				      \
 	      {								      \
 		/* Illegal input.  */					      \