File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ impl Pattern {
214
214
/// regular expression and will represent the matching semantics of this
215
215
/// glob pattern and the options given.
216
216
pub fn to_regex_with ( & self , options : & MatchOptions ) -> String {
217
- let sep = path:: MAIN_SEPARATOR . to_string ( ) ;
217
+ let sep = regex :: quote ( & path:: MAIN_SEPARATOR . to_string ( ) ) ;
218
218
let mut re = String :: new ( ) ;
219
219
re. push_str ( "(?-u)" ) ;
220
220
if options. case_insensitive {
@@ -235,14 +235,14 @@ impl Pattern {
235
235
}
236
236
Token :: Any => {
237
237
if options. require_literal_separator {
238
- re. push_str ( & format ! ( "[^{}]" , regex :: quote ( & sep) ) ) ;
238
+ re. push_str ( & format ! ( "[^{}]" , sep) ) ;
239
239
} else {
240
240
re. push_str ( "." ) ;
241
241
}
242
242
}
243
243
Token :: ZeroOrMore => {
244
244
if options. require_literal_separator {
245
- re. push_str ( & format ! ( "[^{}]*" , regex :: quote ( & sep) ) ) ;
245
+ re. push_str ( & format ! ( "[^{}]*" , sep) ) ;
246
246
} else {
247
247
re. push_str ( ".*" ) ;
248
248
}
You can’t perform that action at this time.
0 commit comments