diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-05 21:20:19 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-05 21:20:19 -0400 |
commit | 3bb387abdd3f6c9a3d16f37fc8abf004eb5bbb35 (patch) | |
tree | 464c766aa3ea2d488f35506879f5516490f882de /src | |
parent | 7f0273c347f287a1c0a02e948f2477a8fdc30a9b (diff) |
Fix glob problem on Windows.0.0.6
We weren't actually escaping every use of the file path separator. D'oh.
Diffstat (limited to 'src')
-rw-r--r-- | src/glob.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glob.rs b/src/glob.rs index 01fdd3e0..faec94e7 100644 --- a/src/glob.rs +++ b/src/glob.rs @@ -214,7 +214,7 @@ impl Pattern { /// regular expression and will represent the matching semantics of this /// glob pattern and the options given. pub fn to_regex_with(&self, options: &MatchOptions) -> String { - let sep = path::MAIN_SEPARATOR.to_string(); + let sep = regex::quote(&path::MAIN_SEPARATOR.to_string()); let mut re = String::new(); re.push_str("(?-u)"); if options.case_insensitive { @@ -235,14 +235,14 @@ impl Pattern { } Token::Any => { if options.require_literal_separator { - re.push_str(&format!("[^{}]", regex::quote(&sep))); + re.push_str(&format!("[^{}]", sep)); } else { re.push_str("."); } } Token::ZeroOrMore => { if options.require_literal_separator { - re.push_str(&format!("[^{}]*", regex::quote(&sep))); + re.push_str(&format!("[^{}]*", sep)); } else { re.push_str(".*"); } |