summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-09-02 13:34:01 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-09-02 13:34:01 +0400
commitfa06cf6edf86aa1839d4f43bfd3bd9a3a36b5223 (patch)
tree705466443ec58fffa74a3499a3bcc56be1cdee9d /encoding.c
parent08f466c86ef859f2f3ab1f65677536cbccd85960 (diff)
parent3a8c2d58eab0410fe5e79a112614aa9be061dc46 (diff)
downloadlibxml2-fa06cf6edf86aa1839d4f43bfd3bd9a3a36b5223.tar.gz
Merge branch 'master' of git://anonscm.debian.org/debian-xml-sgml/libxml2
Conflicts: debian/changelog debian/control debian/rules
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/encoding.c b/encoding.c
index 87b1d9b..7330e90 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1517,6 +1517,8 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) {
if (handler != NULL) return(handler);
handler = xmlFindCharEncodingHandler("EBCDIC-US");
if (handler != NULL) return(handler);
+ handler = xmlFindCharEncodingHandler("IBM-037");
+ if (handler != NULL) return(handler);
break;
case XML_CHAR_ENCODING_UCS4BE:
handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4");
@@ -2161,6 +2163,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
/**
* xmlCharEncInput:
* @input: a parser input buffer
+ * @flush: try to flush all the raw buffer
*
* Generic front-end for the encoding handler on parser input
*
@@ -2170,7 +2173,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
* the result of transformation can't fit into the encoding we want), or
*/
int
-xmlCharEncInput(xmlParserInputBufferPtr input)
+xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
{
int ret = -2;
size_t written;
@@ -2189,7 +2192,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input)
toconv = xmlBufUse(in);
if (toconv == 0)
return (0);
- if (toconv > 64 * 1024)
+ if ((toconv > 64 * 1024) && (flush == 0))
toconv = 64 * 1024;
written = xmlBufAvail(out);
if (written > 0)
@@ -2200,7 +2203,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input)
if (written > 0)
written--; /* count '\0' */
}
- if (written > 128 * 1024)
+ if ((written > 128 * 1024) && (flush == 0))
written = 128 * 1024;
c_in = toconv;