[libxml2] Fix an output buffer flushing conversion bug



commit 8e2098aef7d119ee95228564174d6a87d4183f4a
Author: Mikhail Titov <mlt gmx us>
Date:   Wed Mar 27 11:00:31 2013 +0800

    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

 xmlIO.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/xmlIO.c b/xmlIO.c
index fecdae5..847cb7e 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3725,14 +3725,16 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) {
      */
     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);
     }
 
     /*


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]