aboutsummaryrefslogtreecommitdiff
path: root/src/zen
diff options
context:
space:
mode:
Diffstat (limited to 'src/zen')
-rw-r--r--src/zen/cmds/builds_cmd.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index 84d8424aa..775c3d283 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -1025,19 +1025,22 @@ void
BuildsSubCmdBase::ParseExcludeFolderAndExtension(std::vector<std::string>& OutExcludeFolders,
std::vector<std::string>& OutExcludeExtensions)
{
- auto SplitAndAppendExclusion = [](const std::string_view Input, std::vector<std::string>& Output) {
- ForEachStrTok(Input, ";,", [&Output](std::string_view Exclusion) {
- if (!Exclusion.empty())
- {
- std::string CleanExclusion(ToLower(Exclusion));
- if (CleanExclusion.length() > 2 && CleanExclusion.front() == '"' && CleanExclusion.back() == '"')
- {
- CleanExclusion = CleanExclusion.substr(1, CleanExclusion.length() - 2);
- }
- Output.emplace_back(std::move(CleanExclusion));
- }
- return true;
- });
+ constexpr AsciiSet Whitespace(" ");
+ auto SplitAndAppendExclusion = [&Whitespace](const std::string_view Input, std::vector<std::string>& Output) {
+ ForEachStrTok(Input, ";,", [&Output, &Whitespace](std::string_view Exclusion) {
+ Exclusion = AsciiSet::TrimPrefixWith(Exclusion, Whitespace);
+ Exclusion = AsciiSet::TrimSuffixWith(Exclusion, Whitespace);
+ if (!Exclusion.empty())
+ {
+ std::string CleanExclusion(ToLower(Exclusion));
+ if (CleanExclusion.length() > 2 && CleanExclusion.front() == '"' && CleanExclusion.back() == '"')
+ {
+ CleanExclusion = CleanExclusion.substr(1, CleanExclusion.length() - 2);
+ }
+ Output.emplace_back(std::move(CleanExclusion));
+ }
+ return true;
+ });
};
SplitAndAppendExclusion(m_Config.ExcludeFolders, OutExcludeFolders);
@@ -2546,7 +2549,7 @@ BuildsTestSubCmd::Run(const ZenCliOptions& /*GlobalOptions*/)
std::string RelativePath = std::filesystem::relative(AbsolutePath, Path).generic_string();
for (const std::string& ExcludeFolder : ExcludeFolders)
{
- if (RelativePath.starts_with(ExcludeFolder))
+ if (StrCaseStartsWith(RelativePath, ExcludeFolder))
{
if (RelativePath.length() == ExcludeFolder.length())
{