This commit is contained in:
fur%netscape.com 1999-11-21 07:58:53 +00:00
Родитель ce7df4c683
Коммит ab49175ccc
1 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -328,22 +328,22 @@ nsStorageInputStream::Read(char* aBuffer, PRUint32 aCount, PRUint32 *aNumRead)
remainingCapacity = aCount;
writeCursor = aBuffer;
while (remainingCapacity) {
availableInSegment = mSegmentEnd - mReadCursor;
if (!availableInSegment) {
PRUint32 available = mStorageStream->mLogicalLength - mLogicalCursor;
if (!available)
goto out;
availableInSegment = mSegmentEnd - mReadCursor;
if (!availableInSegment) {
PRUint32 available = mStorageStream->mLogicalLength - mLogicalCursor;
if (!available)
goto out;
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum++);
mSegmentEnd = mReadCursor + PR_MIN(mSegmentSize, available);
}
mReadCursor = mStorageStream->mSegmentedBuffer->GetSegment(mSegmentNum++);
mSegmentEnd = mReadCursor + PR_MIN(mSegmentSize, available);
}
count = PR_MIN(availableInSegment, remainingCapacity);
memcpy(writeCursor, mReadCursor, count);
remainingCapacity -= count;
mReadCursor += count;
writeCursor += count;
mLogicalCursor += count;
count = PR_MIN(availableInSegment, remainingCapacity);
memcpy(writeCursor, mReadCursor, count);
remainingCapacity -= count;
mReadCursor += count;
writeCursor += count;
mLogicalCursor += count;
};
out: