Making sure that mCountRemaining also gets updated when data gets inserted into the scanner buffer. b=117441, r=heikki, sr=jst

This commit is contained in:
harishd%netscape.com 2002-05-15 20:20:55 +00:00
parent d606de2ade
commit 87cecdb92d
2 changed files with 8 additions and 4 deletions

View File

@ -294,8 +294,10 @@ PRBool nsScanner::UngetReadable(const nsAString& aBuffer) {
mSlidingBuffer->UngetReadable(aBuffer,mCurrentPosition);
mSlidingBuffer->BeginReading(mCurrentPosition); // Insertion invalidated our iterators
mSlidingBuffer->EndReading(mEndPosition);
mTotalRead += aBuffer.Length();
PRUint32 length = aBuffer.Length();
mCountRemaining += length; // Ref. bug 117441
mTotalRead += length;
return PR_TRUE;
}

View File

@ -294,8 +294,10 @@ PRBool nsScanner::UngetReadable(const nsAString& aBuffer) {
mSlidingBuffer->UngetReadable(aBuffer,mCurrentPosition);
mSlidingBuffer->BeginReading(mCurrentPosition); // Insertion invalidated our iterators
mSlidingBuffer->EndReading(mEndPosition);
mTotalRead += aBuffer.Length();
PRUint32 length = aBuffer.Length();
mCountRemaining += length; // Ref. bug 117441
mTotalRead += length;
return PR_TRUE;
}