summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qstorageinfo_unix.cpp
diff options
context:
space:
mode:
authorJohannes Rosenqvist <xeroc81@gmail.com>2018-04-29 21:59:54 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-07-12 13:28:42 +0000
commit23870b3cad0463c9a98005a3c661188d0f7b7b2c (patch)
treef7b1754683a80bfc4c2ae8bc374ec1aca3d0481c /src/corelib/io/qstorageinfo_unix.cpp
parent89f7e090efe1c5f0df627f83492174a0f4e47e32 (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.cpp2
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);