diff options
Diffstat (limited to 'sax/source/expatwrap/sax_expat.cxx')
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 96171eabf947..ef28e8340205 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -647,18 +647,23 @@ void SaxExpatParser_Impl::parse( ) while( nRead ) { nRead = getEntity().converter.readAndConvert( seqOut , nBufSize ); + bool bContinue(false); + if( ! nRead ) { - XML_Parse( getEntity().pParser , + // last call - must return OK + XML_Status const ret = XML_Parse( getEntity().pParser, reinterpret_cast<const char *>(seqOut.getConstArray()), 0 , 1 ); - break; - } - - bool bContinue = ( XML_Parse( getEntity().pParser , + if (ret == XML_STATUS_OK) { + break; + } + } else { + bContinue = ( XML_Parse( getEntity().pParser, reinterpret_cast<const char *>(seqOut.getConstArray()), nRead, 0 ) != XML_STATUS_ERROR ); + } if( ! bContinue || bExceptionWasThrown ) { |