diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-24 13:19:38 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-24 13:38:25 +0100 |
commit | c97eb3e18ec0326a469ef37997f6368cf029c766 (patch) | |
tree | be89410d14c1042f469257f0bdb6448027231413 /src/xml | |
parent | e39a9de3309f84be4101da839a0bacf69090706f (diff) | |
parent | 1d9547c9a4b58cadc1105521df27e40ff5945259 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/corelib/global/qglobal.cpp
src/corelib/global/qrandom.cpp
tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
Change-Id: Icc10543a1f2db5d640d01796bfec70a63517a6b2
Diffstat (limited to 'src/xml')
-rw-r--r-- | src/xml/sax/qxml.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index bc7d00483a..717a8c327d 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -1265,18 +1265,8 @@ void QXmlInputSource::fetchData() } else if (device->isOpen() || device->open(QIODevice::ReadOnly)) { rawData.resize(BufferSize); qint64 size = device->read(rawData.data(), BufferSize); - - if (size != -1) { - // We don't want to give fromRawData() less than four bytes if we can avoid it. - while (size < 4) { - if (!device->waitForReadyRead(-1)) - break; - int ret = device->read(rawData.data() + size, BufferSize - size); - if (ret <= 0) - break; - size += ret; - } - } + if (size == 0 && device->waitForReadyRead(-1)) + size = device->read(rawData.data(), BufferSize); rawData.resize(qMax(qint64(0), size)); } |