This commit is contained in:
gabime
2024-04-29 19:46:59 +03:00
parent 238c9ffa5d
commit 94a8e87c71
2 changed files with 71 additions and 0 deletions

View File

@@ -534,6 +534,15 @@ SPDLOG_INLINE bool create_dir(const filename_t &path) {
}
auto subdir = path.substr(0, token_pos);
#ifdef _WIN32
// 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++;
}
#endif
if (!subdir.empty() && !path_exists(subdir) && !mkdir_(subdir)) {
return false; // return error if failed creating dir