summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemengine_win.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-27 13:06:38 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-27 13:06:38 +0200
commit572200989b224ad68e7b8ae4c0aecceb6ca871a2 (patch)
tree5591e8e6c17df64674aa79227ad6b70374c169ff /src/corelib/io/qfilesystemengine_win.cpp
parent7ed024226faa9c53c6bad96fb6c9f38a22d25751 (diff)
parent241eca33ed45f112feed18c6256c31e606f47796 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: configure mkspecs/features/create_cmake.prf Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5
Diffstat (limited to 'src/corelib/io/qfilesystemengine_win.cpp')
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index bee7689535..2c9ed9da3d 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -1034,6 +1034,10 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
}
if (oldslash != -1)
oldslash = dirName.indexOf(QDir::separator(), oldslash);
+ } else if (dirName.size() > 2
+ && dirName.at(1) == QLatin1Char(':')) {
+ // Don't try to call mkdir with just a drive letter
+ oldslash = 2;
}
for (int slash=0; slash != -1; oldslash = slash) {
slash = dirName.indexOf(QDir::separator(), oldslash+1);
@@ -1044,14 +1048,13 @@ bool QFileSystemEngine::createDirectory(const QFileSystemEntry &entry, bool crea
}
if (slash) {
QString chunk = dirName.left(slash);
- bool existed = false;
- if (!isDirPath(chunk, &existed)) {
- if (!existed) {
- if (!mkDir(chunk))
- return false;
- } else {
- return false;
+ if (!mkDir(chunk)) {
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ bool existed = false;
+ if (isDirPath(chunk, &existed) && existed)
+ continue;
}
+ return false;
}
}
}