From 71652ad4bf7b4cfe35473c3f93213c16e7653135 Mon Sep 17 00:00:00 2001 From: Karsten Heimrich Date: Mon, 27 Sep 2021 22:58:57 +0200 Subject: 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 --- src/corelib/io/qfilesystemengine_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io') 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); -- cgit v1.2.3