summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qiodevice.cpp')
-rw-r--r--src/corelib/io/qiodevice.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 8dcccb4..4e14ba8 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -970,6 +970,7 @@ QByteArray QIODevice::readAll()
if (!(d->openMode & Text) && !d->buffer.isEmpty()) {
result = d->buffer.readAll();
readBytes = result.size();
+ d->pos += readBytes;
}
qint64 theSize;
@@ -985,8 +986,8 @@ QByteArray QIODevice::readAll()
} else {
// Read it all in one go.
// If resize fails, don't read anything.
- result.resize(int(theSize - d->pos));
- readBytes = read(result.data(), result.size());
+ result.resize(int(readBytes + theSize - d->pos));
+ readBytes += read(result.data() + readBytes, result.size() - readBytes);
}
if (readBytes <= 0)