summaryrefslogtreecommitdiff
path: root/iconv/loop.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-01-11 07:45:15 +0000
committerJakub Jelinek <jakub@redhat.com>2008-01-11 07:45:15 +0000
commit07b7d301cc62d3f4ff1bbaf668ddc2510f7a55d8 (patch)
treeb7a82272de69e03b1850cb2cf93e25f258769fa2 /iconv/loop.c
parent1e44f485d223b0f2f7b194935a0109cb7b713cc3 (diff)
Updated to fedora-glibc-20080111T0737
Diffstat (limited to 'iconv/loop.c')
-rw-r--r--iconv/loop.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/iconv/loop.c b/iconv/loop.c
index df8c8dce9f..da11bc209d 100644
--- a/iconv/loop.c
+++ b/iconv/loop.c
@@ -1,5 +1,5 @@
/* Conversion loop frame work.
- Copyright (C) 1998-2002, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998-2002, 2003, 2005, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -174,6 +174,15 @@
# define EXTRA_LOOP_DECLS
#endif
+/* Allow using UPDATE_PARAMS in macros where #ifdef UPDATE_PARAMS test
+ isn't possible. */
+#ifndef UPDATE_PARAMS
+# define UPDATE_PARAMS do { } while (0)
+#endif
+#ifndef REINIT_PARAMS
+# define REINIT_PARAMS do { } while (0)
+#endif
+
/* To make it easier for the writers of the modules, we define a macro
to test whether we have to ignore errors. */
@@ -214,6 +223,10 @@
case we are not doing any error recovery outself. */ \
break; \
\
+ /* If needed, flush any conversion state, so that __gconv_transliterate \
+ starts with current shift state. */ \
+ UPDATE_PARAMS; \
+ \
/* First try the transliteration methods. */ \
for (trans = step_data->__trans; trans != NULL; trans = trans->__next) \
{ \
@@ -223,6 +236,9 @@
if (result != __GCONV_ILLEGAL_INPUT) \
break; \
} \
+ \
+ REINIT_PARAMS; \
+ \
/* If any of them recognized the input continue with the loop. */ \
if (result != __GCONV_ILLEGAL_INPUT) \
{ \
@@ -319,9 +335,7 @@ FCTNAME (LOOPFCT) (struct __gconv_step *step,
/* Update the pointers pointed to by the parameters. */
*inptrp = inptr;
*outptrp = outptr;
-#ifdef UPDATE_PARAMS
UPDATE_PARAMS;
-#endif
return result;
}
@@ -492,6 +506,7 @@ gconv_btowc (struct __gconv_step *step, unsigned char c)
#undef EXTRA_LOOP_DECLS
#undef INIT_PARAMS
#undef UPDATE_PARAMS
+#undef REINIT_PARAMS
#undef ONEBYTE_BODY
#undef UNPACK_BYTES
#undef CLEAR_STATE