From 527badc237cf1afd44c7215838ce69ae28dd35d8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 10 Mar 2016 23:20:54 +0000 Subject: 38129: _git: Fix __git_ignore_line's treatment of shell and pattern metacaracters. Builds upon a patch by Jun T. Also upgrade/fix __git_pattern_escape. --- Completion/Unix/Command/_git | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command/_git') diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 6c88ad073..e3d7231d3 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4956,7 +4956,7 @@ __git_committish_range_last () { (( $+functions[__git_pattern_escape] )) || __git_pattern_escape () { - print -r -n ${1//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH} + print -r -n - ${(b)1} } (( $+functions[__git_is_type] )) || @@ -5048,9 +5048,9 @@ __git_ignore_line () { declare -a ignored ignored=() ((CURRENT > 1)) && - ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + ignored+=(${(bQ)line[1,CURRENT-1]}) ((CURRENT < $#line)) && - ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) + ignored+=(${(bQ)line[CURRENT+1,-1]}) $* -F ignored } -- cgit 1.4.1