Show More
@@ -247,7 +247,7 b' def _globre(pat):' | |||||
247 | i, n = 0, len(pat) |
|
247 | i, n = 0, len(pat) | |
248 | res = '' |
|
248 | res = '' | |
249 | group = 0 |
|
249 | group = 0 | |
250 | escape = re.escape |
|
250 | escape = util.re.escape | |
251 | def peek(): |
|
251 | def peek(): | |
252 | return i < n and pat[i] |
|
252 | return i < n and pat[i] | |
253 | while i < n: |
|
253 | while i < n: | |
@@ -310,11 +310,11 b' def _regex(kind, pat, globsuffix):' | |||||
310 | if kind == 're': |
|
310 | if kind == 're': | |
311 | return pat |
|
311 | return pat | |
312 | if kind == 'path': |
|
312 | if kind == 'path': | |
313 | return '^' + re.escape(pat) + '(?:/|$)' |
|
313 | return '^' + util.re.escape(pat) + '(?:/|$)' | |
314 | if kind == 'relglob': |
|
314 | if kind == 'relglob': | |
315 | return '(?:|.*/)' + _globre(pat) + globsuffix |
|
315 | return '(?:|.*/)' + _globre(pat) + globsuffix | |
316 | if kind == 'relpath': |
|
316 | if kind == 'relpath': | |
317 | return re.escape(pat) + '(?:/|$)' |
|
317 | return util.re.escape(pat) + '(?:/|$)' | |
318 | if kind == 'relre': |
|
318 | if kind == 'relre': | |
319 | if pat.startswith('^'): |
|
319 | if pat.startswith('^'): | |
320 | return pat |
|
320 | return pat |
General Comments 0
You need to be logged in to leave comments.
Login now