about summary refs log tree commit diff
path: root/iconvdata/iso646.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/iso646.c')
-rw-r--r--iconvdata/iso646.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/iconvdata/iso646.c b/iconvdata/iso646.c
index c8d0a02121..ba0addcd78 100644
--- a/iconvdata/iso646.c
+++ b/iconvdata/iso646.c
@@ -406,12 +406,20 @@ gconv_end (struct __gconv_step *data)
        when we reach the default case in the `switch' statement.  */	      \
     if (failure == __GCONV_ILLEGAL_INPUT)				      \
       {									      \
-	/* Exit the loop with an error.  */				      \
-	result = failure;						      \
-	break;								      \
+	if (! ignore_errors_p ())					      \
+	  {								      \
+	    /* Exit the loop with an error.  */				      \
+	    result = __GCONV_ILLEGAL_INPUT;				      \
+	    break;							      \
+	  }								      \
+									      \
+	++*converted;							      \
+      }									      \
+    else								      \
+      {									      \
+	put32 (outptr, ch);						      \
+	outptr += 4;							      \
       }									      \
-    put32 (outptr, ch);							      \
-    outptr += 4;							      \
     ++inptr;								      \
   }
 #define EXTRA_LOOP_DECLS	, enum variant var
@@ -875,11 +883,17 @@ gconv_end (struct __gconv_step *data)
 									      \
     if (failure == __GCONV_ILLEGAL_INPUT)				      \
       {									      \
-	/* Exit the loop with an error.  */				      \
-	result = failure;						      \
-	break;								      \
+	if (! ignore_errors_p ())					      \
+	  {								      \
+	    /* Exit the loop with an error.  */				      \
+	    result = __GCONV_ILLEGAL_INPUT;				      \
+	    break;							      \
+	  }								      \
+									      \
+	++*converted;							      \
       }									      \
-    *outptr++ = (unsigned char) ch;					      \
+    else								      \
+      *outptr++ = (unsigned char) ch;					      \
     inptr += 4;								      \
   }
 #define EXTRA_LOOP_DECLS	, enum variant var