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