##// END OF EJS Templates
rust-regex: prevent nonsensical `.*.*` pattern from happening...
Raphaël Gomès -
r45348:1e9bfeae default
parent child Browse files
Show More
@@ -181,7 +181,10 b' fn _build_single_regex(entry: &IgnorePat'
181 181 // The `regex` crate accepts `**` while `re2` and Python's `re`
182 182 // do not. Checking for `*` correctly triggers the same error all
183 183 // engines.
184 if pattern[0] == b'^' || pattern[0] == b'*' {
184 if pattern[0] == b'^'
185 || pattern[0] == b'*'
186 || pattern.starts_with(b".*")
187 {
185 188 return pattern.to_owned();
186 189 }
187 190 [&b".*"[..], pattern].concat()
General Comments 0
You need to be logged in to leave comments. Login now