diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-26 18:16:48 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2018-07-30 15:05:29 +0000 |
commit | f69a5857d115786f44d053e68c36f74526020e82 (patch) | |
tree | 4e1c1876db2fc124d4f1d94a792836d53c401342 /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | ed79462d997324d7adfeef21d1ffe386f8603967 (diff) |
canonicalFilePath: treat ENOTDIR as a case of file not existing
There is no such file, if one of the "directory" components of its
path is not, in fact, a directory. Added a test for non-existent file
(specified to give empty canonical file path) as well as a test for a
file in a sub-directory of a known file. The former incidentally
tests for QTBUG-29402, fixed long ago.
Change-Id: I60b80acc0f99f0a88cdb1c4d191af7384f3a31c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 7975ac1d96..9d20ef5088 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -774,7 +774,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, QString canonicalPath = QDir::cleanPath(QFile::decodeName(ret)); free(ret); return QFileSystemEntry(canonicalPath); - } else if (errno == ENOENT) { // file doesn't exist + } else if (errno == ENOENT || errno == ENOTDIR) { // file doesn't exist data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute; data.entryFlags &= ~(QFileSystemMetaData::ExistsAttribute); return QFileSystemEntry(); |