Skip to content

Commit

Permalink
Merge pull request #60 from zao/fix/exact-file-search
Browse files Browse the repository at this point in the history
fix: drop leading garbage from exact glob pattern
  • Loading branch information
zao authored Jul 16, 2024
2 parents b9118e2 + 96d8e46 commit 760bb41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/system/win/sys_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ bool GlobMatch(const std::filesystem::path& glob, const std::filesystem::path& f
// If no wildcards are present, test file path verbatim.
// We use a regex rather than string comparisons to make it case-insensitive.
if (globStr.find_first_of("?*") == std::string::npos) {
buf.resize(globStr.size());
buf.reserve(globStr.size() * 3); // Decent estimate of final pattern size.

for (char ch : globStr) {
fmt::format_to(fmt::appender(buf), "[{}]", ch);
}
Expand Down

0 comments on commit 760bb41

Please sign in to comment.