diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index 2f0f1bde..3b689225 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -286,6 +286,14 @@ bool create_dir(const filename_t &path) { auto subdir = path.substr(0, token_pos); + // if subdir is just a drive letter, add a slash e.g. "c:"=>"c:\", + // otherwise path_exists(subdir) returns false (issue #3079) + const bool is_drive = subdir.length() == 2 && subdir[1] == ':'; + if (is_drive) { + subdir += '\\'; + token_pos++; + } + if (!subdir.empty() && !path_exists(subdir) && !mkdir_(subdir)) { return false; // return error if failed creating dir }