diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2010-08-22 15:54:36 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2010-08-22 15:54:36 +0000 |
commit | 059c8dede666e4b7698f141687e67441c469541e (patch) | |
tree | 09d753e9595a494e4f0536926306c9c5b4566fc4 /Completion/Base/Utility | |
parent | a7551af424572610e9d2cb68337487a9c4fa6ae9 (diff) | |
download | zsh-059c8dede666e4b7698f141687e67441c469541e.tar.gz zsh-059c8dede666e4b7698f141687e67441c469541e.tar.xz zsh-059c8dede666e4b7698f141687e67441c469541e.zip |
28186: replace (...|...) pattern-match with a loop over the alternatives to
avoid issues with pattern-quoting each alternative.
Diffstat (limited to 'Completion/Base/Utility')
-rw-r--r-- | Completion/Base/Utility/_multi_parts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Completion/Base/Utility/_multi_parts b/Completion/Base/Utility/_multi_parts index 6fb6cbdb1..3e2f36c9c 100644 --- a/Completion/Base/Utility/_multi_parts +++ b/Completion/Base/Utility/_multi_parts @@ -127,7 +127,8 @@ while true; do return fi elif (( $#tmp1 )); then - local ret=1 + local ret=1 tt + local -a mm # More than one match. First we get all strings that match the # rest from the line. @@ -144,7 +145,11 @@ while true; do SUFFIX="$suf" fi - matches=( "${(@M)matches:#(${(j:|:)~${(q)tmp1}})*}" ) + for tt in $tmp1 + do + mm+=( "${(@M)matches:#$tt*}" ) + done + matches=( $mm ) if ! zstyle -t ":completion:${curcontext}:" expand suffix || [[ -n "$menu" || -z "$compstate[insert]" ]]; then |