From 754be3eec64acd7f2ffe98dd07297d4ef099cebe Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 25 Nov 2024 09:19:41 +0200 Subject: [PATCH] Fix #3079 --- src/details/os_windows.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/details/os_windows.cpp b/src/details/os_windows.cpp index 2f0f1bde..3b689225 100644 --- a/src/details/os_windows.cpp +++ b/src/details/os_windows.cpp @@ -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 }