diff options
author | Johannes Rosenqvist <xeroc81@gmail.com> | 2018-04-29 21:59:54 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-12 13:28:42 +0000 |
commit | 23870b3cad0463c9a98005a3c661188d0f7b7b2c (patch) | |
tree | f7b1754683a80bfc4c2ae8bc374ec1aca3d0481c /src/corelib/io/qstorageinfo_unix.cpp | |
parent | 89f7e090efe1c5f0df627f83492174a0f4e47e32 (diff) |
Fix QStorageIterator where the last line in /proc/mounts is skipped
On Android systems QStorageIterator uses /proc/mounts to parse mounted
volumes. For every call to QStorageIterator::next() a check was done
to see if we had reached EOF with atEnd(), but didn't take account of
the last call to file.readLine(), which might contain a valid entry.
[ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused the last
entry in the mtab file to be ignored on Android.
Task-number: QTBUG-60215
Change-Id: I064452002922c72ffa1c8954fec5f28738c42bae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qstorageinfo_unix.cpp')
-rw-r--r-- | src/corelib/io/qstorageinfo_unix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp index 7664b77d81..15d78cb985 100644 --- a/src/corelib/io/qstorageinfo_unix.cpp +++ b/src/corelib/io/qstorageinfo_unix.cpp @@ -347,7 +347,7 @@ inline bool QStorageIterator::next() data = line.split(' '); } while (data.count() < 3 && !file.atEnd()); - if (file.atEnd()) + if (file.atEnd() && data.count() <= 3) return false; m_device = data.at(0); m_rootPath = data.at(1); |