Fix Utility::MkDirP on Windows

fixes #11455
This commit is contained in:
Gunnar Beutner 2016-03-29 09:43:40 +02:00 committed by Gunnar Beutner
parent e314bc1ad5
commit 0d2ae5ce92
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}