Skip to content

Commit 71c4f88

Browse files
committed
Apply upstream patch
Signed-off-by: y <[email protected]>
1 parent 83fa20b commit 71c4f88

File tree

1 file changed

+9
-0
lines changed
  • third_party/spdlog_headers/spdlog/details

1 file changed

+9
-0
lines changed

third_party/spdlog_headers/spdlog/details/os-inl.h

+9
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,15 @@ SPDLOG_INLINE bool create_dir(const filename_t &path) {
534534
}
535535

536536
auto subdir = path.substr(0, token_pos);
537+
#ifdef _WIN32
538+
// if subdir is just a drive letter, add a slash e.g. "c:"=>"c:\",
539+
// otherwise path_exists(subdir) returns false (issue #3079)
540+
const bool is_drive = subdir.length() == 2 && subdir[1] == ':';
541+
if (is_drive) {
542+
subdir += '\\';
543+
token_pos++;
544+
}
545+
#endif
537546

538547
if (!subdir.empty() && !path_exists(subdir) && !mkdir_(subdir)) {
539548
return false; // return error if failed creating dir

0 commit comments

Comments
 (0)