summary refs log tree commit diff
path: root/iconvdata/euc-tw.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/euc-tw.c')
-rw-r--r--iconvdata/euc-tw.c57
1 files changed, 8 insertions, 49 deletions
diff --git a/iconvdata/euc-tw.c b/iconvdata/euc-tw.c
index 6b3c6bae91..8d3b1aa1b5 100644
--- a/iconvdata/euc-tw.c
+++ b/iconvdata/euc-tw.c
@@ -1,5 +1,5 @@
 /* Mapping tables for EUC-TW handling.
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -49,15 +49,7 @@
     else if ((ch <= 0xa0 || ch > 0xfe) && ch != 0x8e)			      \
       {									      \
 	/* This is illegal.  */						      \
-	if (! ignore_errors_p ())					      \
-	  {								      \
-	    result = __GCONV_ILLEGAL_INPUT;				      \
-	    break;							      \
-	  }								      \
-									      \
-	++inptr;							      \
-	++*irreversible;						      \
-	continue;							      \
+	STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
       }									      \
     else								      \
       {									      \
@@ -77,18 +69,7 @@
 									      \
 	/* All second bytes of a multibyte character must be >= 0xa1. */      \
 	if (ch2 < 0xa1 || ch2 == 0xff)					      \
-	  {								      \
-	    /* This is illegal.  */					      \
-	    if (! ignore_errors_p ())					      \
-	      {								      \
-	        result = __GCONV_ILLEGAL_INPUT;				      \
-	        break;							      \
-	      }								      \
-									      \
-	    ++inptr;							      \
-	    ++*irreversible;						      \
-	    continue;							      \
-	  }								      \
+	  STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
 									      \
 	if (ch == 0x8e)							      \
 	  {								      \
@@ -106,19 +87,8 @@
 	      }								      \
 									      \
 	    if (ch == __UNKNOWN_10646_CHAR)				      \
-	      {								      \
-		/* Illegal input.  */					      \
-		if (! ignore_errors_p ())				      \
-		  {							      \
-		    /* This is an illegal character.  */		      \
-		    result = __GCONV_ILLEGAL_INPUT;			      \
-		    break;						      \
-		  }							      \
-									      \
-		++inptr;						      \
-		++*irreversible;					      \
-		continue;						      \
-	      }								      \
+	      /* Illegal input.  */					      \
+	      STANDARD_FROM_LOOP_ERR_HANDLER (1);			      \
 									      \
 	    inptr += 4;							      \
 	  }								      \
@@ -131,19 +101,8 @@
 	    /* Please note that we need not test for the missing input	      \
 	       characters here anymore.  */				      \
 	    if (ch == __UNKNOWN_10646_CHAR)				      \
-	      {								      \
-		/* Illegal input.  */					      \
-		if (! ignore_errors_p ())				      \
-		  {							      \
-		    /* This is an illegal character.  */		      \
-		    result = __GCONV_ILLEGAL_INPUT;			      \
-		    break;						      \
-		  }							      \
-									      \
-		inptr += 2;						      \
-		++*irreversible;					      \
-		continue;						      \
-	      }								      \
+	      /* Illegal input.  */					      \
+	      STANDARD_FROM_LOOP_ERR_HANDLER (2);			      \
 									      \
 	    inptr += 2;							      \
 	  }								      \
@@ -202,7 +161,7 @@
 		UNICODE_TAG_HANDLER (ch, 4);				      \
 									      \
 		/* Illegal character.  */				      \
-		STANDARD_ERR_HANDLER (4);				      \
+		STANDARD_TO_LOOP_ERR_HANDLER (4);			      \
 	      }								      \
 									      \
 	    /* It's a CNS 11643 character, adjust it for EUC-TW.  */	      \