This commit is contained in:
gabime 2024-11-25 09:19:41 +02:00
parent 5884f4de2a
commit 754be3eec6

View File

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