From d994e54712efb69225d73d93fc57b89a3d39cacb Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 14 Jun 2018 12:23:04 +0200 Subject: 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 --- src/lib/corelib/tools/fileinfo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3