Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft
diff options
context:
space:
mode:
authorLeitwolf112026-11-06 02:55:57 +0300
committerLeitwolf112026-11-06 02:55:57 +0300
commitad3633ea59ec491c9694a10307beb7d7189db744 (patch)
tree99c4d53afb06eb1f2479392bdf56d9bc95621166 /src/Progmasoft
parent89b4769c35986444a0297ad0806a584c7181c85c (diff)
downloadcatch3-fix/child-environment.tar.gz
Compare Windows variable names in UTF-8 and end an empty block twicefix/child-environment
EnvironmentBlock replaced every non-ASCII character of an inherited name with '?' before asking whether to withhold it, so --pass-env=MY_?_TOKEN kept an unrelated MY_é_TOKEN. Names are now converted with Narrow, as everything else the runner compares. A block whose variables were all withheld, with no additions, ended in one terminator; CreateProcessW needs two for an empty block. The amalgamated sources are regenerated for the runner changes.
Diffstat (limited to 'src/Progmasoft')
-rw-r--r--src/Progmasoft/Runner/Process.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/Progmasoft/Runner/Process.cpp b/src/Progmasoft/Runner/Process.cpp
index b9463e94..85987210 100644
--- a/src/Progmasoft/Runner/Process.cpp
+++ b/src/Progmasoft/Runner/Process.cpp
@@ -247,14 +247,7 @@ namespace Progmasoft::Catch3::Runner
// A leading '=' marks the hidden per-drive variables.
const std::wstring_view text{ entry };
const auto equals = text.find(L'=', 1);
- std::string name;
- for (const wchar_t character : text.substr(0, equals))
- {
- name.push_back(character < 0x80
- ? static_cast<char>(character)
- : '?');
- }
- if (Withheld(name, kept))
+ if (Withheld(Narrow(text.substr(0, equals)), kept))
{
continue;
}
@@ -289,6 +282,12 @@ namespace Progmasoft::Catch3::Runner
block += entry;
block.push_back(L'\0');
}
+ // A block ends in an empty entry; one without variables is two
+ // terminators.
+ if (entries.empty())
+ {
+ block.push_back(L'\0');
+ }
block.push_back(L'\0');
return block;
}