소스 검색

Fix: handling regex characters in path patterns

Before this commit if a regex-special character was present on the
commandline as a part of path pattern autojump would fail with
`sre_constants.error`.
pull/430/head
Marek Marecki 8 년 전
committed by William Ting
부모
커밋
9622659099
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      bin/autojump

+ 1
- 1
bin/autojump 파일 보기

@ -279,7 +279,7 @@ def match_consecutive(needles, haystack, ignore_case=False):
regex_no_sep_end = regex_no_sep + '$'
regex_one_sep = regex_no_sep + sep + regex_no_sep
# can't use compiled regex because of flags
regex_needle = regex_one_sep.join(needles).replace('\\', '\\\\') + regex_no_sep_end # noqa
regex_needle = regex_one_sep.join(map(re.escape, needles)).replace('\\', '\\\\') + regex_no_sep_end # noqa
regex_flags = re.IGNORECASE | re.UNICODE if ignore_case else re.UNICODE
found = lambda entry: re.search(
regex_needle,

불러오는 중...
취소
저장