Fix an output buffer flushing conversion bug
for https://bugzilla.gnome.org/show_bug.cgi?id=694982
On a flush operation, everything must be converted
diff --git a/xmlIO.c b/xmlIO.c
index fecdae5..847cb7e 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3725,14 +3725,16 @@
*/
if ((out->conv != NULL) && (out->encoder != NULL)) {
/*
- * convert as much as possible to the parser reading buffer.
+ * convert as much as possible to the parser output buffer.
*/
- nbchars = xmlCharEncOutput(out, 0);
- if (nbchars < 0) {
- xmlIOErr(XML_IO_ENCODER, NULL);
- out->error = XML_IO_ENCODER;
- return(-1);
- }
+ do {
+ nbchars = xmlCharEncOutput(out, 0);
+ if (nbchars < 0) {
+ xmlIOErr(XML_IO_ENCODER, NULL);
+ out->error = XML_IO_ENCODER;
+ return(-1);
+ }
+ } while (nbchars);
}
/*