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

Bug with escaped character and double star #96

Closed
tdurieux opened this issue Jan 6, 2025 · 2 comments
Closed

Bug with escaped character and double star #96

tdurieux opened this issue Jan 6, 2025 · 2 comments
Assignees
Labels

Comments

@tdurieux
Copy link
Contributor

tdurieux commented Jan 6, 2025

Hello @bmatcuk ,

Thank you for the lib, it is really nice!

I believe I face a bug today, it seems that the double star (**) does not seem to work when there is an escaped character in the pattern such as:
for a given path app/[name]/page.tsx where [name] is not a parameter but the name of a folder, the pattern app/\[name\]/** would not match the path.

Here is a test case for doublestar_test.go:
{"e/\\[owner\\]/*", "e/[owner]/p.tsx", true, true, nil, false, false, true, !onWindows, 1, 0},

I will try to find and fix the bug but I expect that you will be faster than me to identify the problem.

Thank you for your help!

@bmatcuk
Copy link
Owner

bmatcuk commented Jan 13, 2025

Hey there! Sorry for the slow reply! Definitely looks like you found a bug. I checked out your PR and you got it mostly right - there were two places where we did not want to call unescapeMeta. I've fixed those and added a few more test cases. I also made SplitPattern unescape the base path that is returned.

I've released v4.8.0 with the fixes =)

@bmatcuk bmatcuk closed this as completed Jan 13, 2025
@tdurieux
Copy link
Contributor Author

Thanks a lot for the review and the fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants