about summary refs log tree commit diff
path: root/iconvdata/8bit-generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/8bit-generic.c')
-rw-r--r--iconvdata/8bit-generic.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/iconvdata/8bit-generic.c b/iconvdata/8bit-generic.c
index 97ca193194..62160c6efa 100644
--- a/iconvdata/8bit-generic.c
+++ b/iconvdata/8bit-generic.c
@@ -18,6 +18,8 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <dlfcn.h>
+
 #define FROM_LOOP		from_generic
 #define TO_LOOP			to_generic
 #define DEFINE_INIT		1
@@ -50,6 +52,7 @@
     outptr += 4;							      \
     ++inptr;								      \
   }
+#define LOOP_NEED_FLAGS
 #include <iconv/loop.c>
 
 
@@ -65,19 +68,32 @@
 	|| (__builtin_expect (from_ucs4[ch], '\1') == '\0' && ch != 0))	      \
       {									      \
 	/* This is an illegal character.  */				      \
-	if (! ignore_errors_p ())					      \
+	if (step_data->__trans.__trans_fct != NULL)			      \
+	  {								      \
+	    result = DL_CALL_FCT (step_data->__trans.__trans_fct,	      \
+				  (step, step_data, *inptrp, &inptr, inend,   \
+				   *outptrp, &outptr, outend, irreversible)); \
+	    if (result != __GCONV_OK)					      \
+	      break;							      \
+	  }								      \
+	else if (! ignore_errors_p ())					      \
 	  {								      \
 	    result = __GCONV_ILLEGAL_INPUT;				      \
 	    break;							      \
 	  }								      \
-									      \
-	++*irreversible;						      \
+	else								      \
+	  {								      \
+	    ++*irreversible;						      \
+	    inptr += 4;							      \
+	  }								      \
       }									      \
     else								      \
-      *outptr++ = from_ucs4[ch];					      \
-									      \
-    inptr += 4;								      \
+      {									      \
+	*outptr++ = from_ucs4[ch];					      \
+	inptr += 4;							      \
+      }									      \
   }
+#define LOOP_NEED_FLAGS
 #include <iconv/loop.c>