devongovett / glob-match

An extremely fast glob matching library in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leading doublestar inside braces fails to match

gsoltis opened this issue · comments

If you have a glob that starts with a **, the behavior changes based on whether or not you wrap it in {}s. For instance:

assert!(glob_match("**/*b", "ab"));
assert!(glob_match("{**/*b}", "ab"));

The first assert passes, whereas the second one does not. I believe the issue is here, where the code to detect a leading doublestar is hardcoded to compare against the start of the glob, rather than the start of the current option inside the braces.