diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-09-27 22:58:57 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2021-10-20 15:04:51 +0000 |
commit | 71652ad4bf7b4cfe35473c3f93213c16e7653135 (patch) | |
tree | e5fac67d20f5dc3713623242a0ae40945eb11a23 /src/corelib/io | |
parent | 57ec47921e1e703372c1a69a5e3b375ef3918acc (diff) |
Make QDir::mkpath() return true when given an existing drive name
Commit ed48391c592e8ba68c723e3017ac384f0c7a7c23 removed the check for
ERROR_ACCESS_DENIED reported by the Windows CreateDirectory(...)
function in case an existing windows drive name was passed as argument.
This restores the behavior of the function which broke after 5.15.
Pick-to: 6.2
Fixes: QTBUG-85997
Change-Id: Ie86188100766f7364acee57b15a250f4a2720b9f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index d1a197698e..9e009a05e7 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -1180,7 +1180,7 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea // mkpath should return true, if the directory already exists, mkdir false. if (!createParents) return false; - if (lastError == ERROR_ALREADY_EXISTS) + if (lastError == ERROR_ALREADY_EXISTS || lastError == ERROR_ACCESS_DENIED) return isDirPath(dirName, nullptr); return createDirectoryWithParents(dirName, false); |