Skip to content

Commit

Permalink
Apply upstream patch
Browse files Browse the repository at this point in the history
Signed-off-by: y <[email protected]>
  • Loading branch information
Jemale committed Jun 26, 2024
1 parent 83fa20b commit 71c4f88
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions third_party/spdlog_headers/spdlog/details/os-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71c4f88

Please sign in to comment.