summaryrefslogtreecommitdiff
path: root/xmlIO.c
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2008-04-09 10:33:41 +0200
committerMike Hommey <glandium@debian.org>2008-04-09 10:33:41 +0200
commit88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d (patch)
treee12ef38cd8eb205c495e5718852d758b95e3a3c6 /xmlIO.c
parentfc760252aba4054a612dd20b803d0c7c19713064 (diff)
downloadlibxml2-88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d.tar.gz
Load /tmp/libxml2-2.6.32 intoupstream/2.6.32.dfsg
libxml2/branches/upstream/current.
Diffstat (limited to 'xmlIO.c')
-rw-r--r--xmlIO.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmlIO.c b/xmlIO.c
index 7782776..dd4f7e7 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3315,6 +3315,16 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
cons = len;
chunk = (out->buffer->size - out->buffer->use) - 1;
+ /*
+ * make sure we have enough room to save first, if this is
+ * not the case force a flush, but make sure we stay in the loop
+ */
+ if (chunk < 40) {
+ nbchars = 0;
+ oldwritten = -1;
+ goto flush;
+ }
+
/*
* first handle encoding stuff.
*/
@@ -3360,6 +3370,7 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
if ((nbchars < MINLEN) && (len <= 0))
goto done;
+flush:
if (out->writecallback) {
/*
* second write the stuff to the I/O channel