2007-11-08 Matthias Clasen <mclasen@redhat.com>
+ * glib/gconvert.c (g_convert_with_iconv): Try harder to reset
+ shift state with AIX iconv(). (#467537)
+
+2007-11-08 Matthias Clasen <mclasen@redhat.com>
+
* configure.in:
* m4macros/glib-2.0.m4: Require pkg-config 0.16 in configure
and in AM_PATH_GLIB_2_0 to be consistent with the use of
gchar *dest;
gchar *outp;
const gchar *p;
- const gchar *shift_p = NULL;
gsize inbytes_remaining;
gsize outbytes_remaining;
gsize err;
gsize outbuf_size;
gboolean have_error = FALSE;
gboolean done = FALSE;
+ gboolean reset = FALSE;
g_return_val_if_fail (converter != (GIConv) -1, NULL);
while (!done && !have_error)
{
- err = g_iconv (converter, (char **)&p, &inbytes_remaining, &outp, &outbytes_remaining);
+ if (reset)
+ err = g_iconv (converter, NULL, &inbytes_remaining, &outp, &outbytes_remaining);
+ else
+ err = g_iconv (converter, (char **)&p, &inbytes_remaining, &outp, &outbytes_remaining);
if (err == (gsize) -1)
{
}
else
{
- if (!shift_p)
+ if (!reset)
{
/* call g_iconv with NULL inbuf to cleanup shift state */
- shift_p = p;
- p = NULL;
+ reset = TRUE;
inbytes_remaining = 0;
}
else
}
}
- if (shift_p)
- p = shift_p;
-
*outp = '\0';
if (bytes_read)