From 016f47d6e6c23e177fe5a9dd37f8289fb0dba78b Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 29 Mar 2016 09:43:40 +0200 Subject: [PATCH] Fix Utility::MkDirP on Windows fixes #11455 --- lib/base/utility.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index 2cf581fe0..dfb0614db 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -726,7 +726,11 @@ void Utility::MkDirP(const String& path, int mode) #else /*_ WIN32 */ pos = path.FindFirstOf("/\\", pos + 1); #endif /* _WIN32 */ - MkDir(path.SubStr(0, pos), mode); + + String spath = path.SubStr(0, pos + 1); + struct stat statbuf; + if (stat(spath.CStr(), &statbuf) < 0 && errno == ENOENT) + MkDir(path.SubStr(0, pos), mode); } }