Skip to content

Commit 58a3d02

Browse files
committed
fix(toolchain): the override warning names a path outside the project by its absolute form on Windows too
A relative path that leaves the current directory is tested by its first component, not by the native string's prefix.
1 parent 82c1d87 commit 58a3d02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/build/prepare/toolchain.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static void warn_toolchain_override(const std::string& given, const std::string&
6767
if (auto it = tc.fileByPlatform.find(key); it != tc.fileByPlatform.end()) file = it->second;
6868
std::error_code ec;
6969
auto shown = std::filesystem::relative(file, std::filesystem::current_path(), ec);
70-
if (ec || shown.empty() || shown.native().starts_with("..")) shown = file;
70+
if (ec || shown.empty() || *shown.begin() == "..") shown = file;
7171
mcpp::diag::warning("toolchain/override", std::format(
7272
"--toolchain {} replaces {} declared at [toolchain].{} ({})",
7373
given, declared, key, shown.generic_string()));

0 commit comments

Comments
 (0)