Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make file searches case-insensitive #50

Merged

Conversation

zao
Copy link
Contributor

@zao zao commented Mar 26, 2024

As we moved from WinAPI FindFirstFile to std::filesystem path tests and globbing was accidentally made case-sensitive as we use direct string comparison or regular expressions to match files.

We now always construct a regular expression for the glob and make the regex match case-insensitive. The regex is rebuilt on every file test but as the set of files is likely to be small this is of low impact; caching the regex in the search object would spread RE2 into the header.

As we moved from WinAPI `FindFirstFile` to `std::filesystem` path tests
and globbing was accidentally made case-sensitive as we use direct
string comparison or regular expressions to match files.

We now always construct a regular expression for the glob and make the
regex match case-insensitive. The regex is rebuilt on every file test
but as the set of files is likely to be small this is of low impact;
caching the regex in the search object would spread RE2 into the header.
@Wires77 Wires77 merged commit 2d4782f into PathOfBuildingCommunity:master Mar 27, 2024
@zao zao deleted the fix/case-insensitive-file-search branch March 28, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants