Show More
@@ -125,11 +125,14 b' def _globre(pat):' | |||
|
125 | 125 | i, n = 0, len(pat) |
|
126 | 126 | res = '' |
|
127 | 127 | group = 0 |
|
128 | escape = re.escape | |
|
128 | 129 | def peek(): return i < n and pat[i] |
|
129 | 130 | while i < n: |
|
130 | 131 | c = pat[i] |
|
131 | 132 | i = i+1 |
|
132 |
if c |
|
|
133 | if c not in '*?[{},\\': | |
|
134 | res += escape(c) | |
|
135 | elif c == '*': | |
|
133 | 136 | if peek() == '*': |
|
134 | 137 | i += 1 |
|
135 | 138 | res += '.*' |
@@ -165,11 +168,11 b' def _globre(pat):' | |||
|
165 | 168 | p = peek() |
|
166 | 169 | if p: |
|
167 | 170 | i += 1 |
|
168 |
res += |
|
|
171 | res += escape(p) | |
|
169 | 172 | else: |
|
170 |
res += |
|
|
173 | res += escape(c) | |
|
171 | 174 | else: |
|
172 |
res += |
|
|
175 | res += escape(c) | |
|
173 | 176 | return res |
|
174 | 177 | |
|
175 | 178 | def _regex(kind, name, tail): |
General Comments 0
You need to be logged in to leave comments.
Login now