Fix for bug 291827 (Expat's byte position is bogus if a chunk boundary falls before we block). r/sr=bz, a=bsmedberg.

git-svn-id: svn://10.0.0.236/trunk@176607 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2005-07-26 13:08:30 +00:00
parent b73bf700ec
commit 4ed1feff94

View File

@@ -1568,8 +1568,11 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
}
/* BEGIN MOZILLA CHANGE (Blocking parser) */
else if (errorCode == XML_ERROR_SUSPENDED) {
int unparsed = bufferEnd - eventEndPtr;
bufferPtr = eventPtr;
parseEndPtr = eventEndPtr;
bufferEnd -= unparsed; /* Substract what we haven't parsed */
parseEndByteIndex -= unparsed;
XmlUpdatePosition(encoding, positionPtr, eventEndPtr, &position);
return XML_STATUS_ERROR;
}