Index: glib/gconvert.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gconvert.c,v
retrieving revision 1.74
diff -u -r1.74 gconvert.c
--- glib/gconvert.c	27 Apr 2005 09:50:08 -0000	1.74
+++ glib/gconvert.c	1 Aug 2005 19:49:14 -0000
@@ -628,6 +628,23 @@
 	}
     }
 
+ shift_again:
+
+  err = g_iconv (converter, NULL, NULL, &outp, &outbytes_remaining);
+
+  if (err == (size_t) -1)
+    {
+      size_t used = outp - dest;
+      
+      outbuf_size *= 2;
+      dest = g_realloc (dest, outbuf_size);
+      
+      outp = dest + used;
+      outbytes_remaining = outbuf_size - used - 1; /* -1 for nul */
+      
+      goto shift_again;
+    }
+  
   *outp = '\0';
   
   if (bytes_read)
@@ -857,6 +874,23 @@
 	  else
 	    done = TRUE;
 	}
+    }
+
+ shift_again:
+
+  err = g_iconv (cd, NULL, NULL, &outp, &outbytes_remaining);
+
+  if (err == (size_t) -1)
+    {
+      size_t used = outp - dest;
+      
+      outbuf_size *= 2;
+      dest = g_realloc (dest, outbuf_size);
+      
+      outp = dest + used;
+      outbytes_remaining = outbuf_size - used - 1; /* -1 for nul */
+      
+      goto shift_again;
     }
 
   /* Cleanup
