mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 00:48:23 -06:00
env: don't explode when GetShortPathNameW fails (#19284)
It fails inside app containers (!) such as the one used by LocalTests.
This commit is contained in:
parent
9e10436a80
commit
91c9a14a71
@ -366,12 +366,13 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
||||
if (til::compare_ordinal_insensitive(var, temp) == 0 ||
|
||||
til::compare_ordinal_insensitive(var, tmp) == 0)
|
||||
{
|
||||
return til::details::wil_env::GetShortPathNameW<std::wstring, 256>(value.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::wstring{ value };
|
||||
std::wstring shortPath;
|
||||
if (SUCCEEDED((til::details::wil_env::GetShortPathNameW<std::wstring, 256>(value.data(), shortPath))))
|
||||
{
|
||||
return shortPath;
|
||||
}
|
||||
}
|
||||
return std::wstring{ value };
|
||||
}
|
||||
|
||||
static bool is_path_var(std::wstring_view input) noexcept
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user