aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-06-14 12:23:04 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-06-14 11:45:52 +0000
commitd994e54712efb69225d73d93fc57b89a3d39cacb (patch)
tree5cbb5633b364ef3c9fc29c69090f292769a371a3
parent7e538cf17b0899ba6a8b6033b0f919464a9f9025 (diff)
Fix FileInfo::isDir() on Unix
The function could return true for non-existing files. This amends b29168f50, which erroneously assumed that could only happen on Windows. Change-Id: Ic5fa50b2035b52ff078194624623a7b46e90672f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--src/lib/corelib/tools/fileinfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/corelib/tools/fileinfo.cpp b/src/lib/corelib/tools/fileinfo.cpp
index a1571b954..3adacc883 100644
--- a/src/lib/corelib/tools/fileinfo.cpp
+++ b/src/lib/corelib/tools/fileinfo.cpp
@@ -360,8 +360,10 @@ QString applicationDirPath()
FileInfo::FileInfo(const QString &fileName)
{
- if (stat(fileName.toLocal8Bit(), &m_stat) == -1)
+ if (stat(fileName.toLocal8Bit(), &m_stat) == -1) {
m_stat.st_mtime = 0;
+ m_stat.st_mode = 0;
+ }
}
bool FileInfo::exists() const