mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 18:41:35 +08:00
Fix #3079
This commit is contained in:
parent
5884f4de2a
commit
754be3eec6
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user