Details
Description
QTextStream writes wrong end line characters after readLine method was called at end of file.
After inspecting QTextStreamPrivate::fillReadBuffer:
Here texMode flag is changed in QIODevice:
// handle text translation and bypass the Text flag in the device. bool textModeEnabled = device->isTextModeEnabled(); if (textModeEnabled) device->setTextModeEnabled(false);
Here it is restored:
// reset the Text flag. if (textModeEnabled) device->setTextModeEnabled(true);
But it will never be restored if this condition is true:
if (bytesRead <= 0) return false;
Attachments
For Gerrit Dashboard: QTBUG-47176 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
142308,2 | Ensure QTextStream doesn't modify the Text flag on the underlying iodevice | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |
151983,3 | tst_QTextStream::textModeOnEmptyRead(): Create file in temporary directory. | 5.6 | qt/qtbase | Status: MERGED | +2 | 0 |