From 4d5d0327a1f4b16ed3dd3056d0c73e86a1d6582b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 5 Jul 2007 18:23:13 +0000 Subject: bad use of indices in _combination --- Completion/Base/Utility/_combination | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Completion/Base/Utility/_combination b/Completion/Base/Utility/_combination index dcb3269cd..d47d4ce31 100644 --- a/Completion/Base/Utility/_combination +++ b/Completion/Base/Utility/_combination @@ -72,13 +72,21 @@ pats=( "${(@)keys/*/*}" ) while [[ "$1" = *=* ]]; do tmp="${1%%\=*}" key="${tmp%:*}" - num="${${tmp##*:}:-1}" + if [[ $1 = *:* ]]; then + num=${tmp##*:} + else + num=1 + fi pats[$keys[(in:num:)$key]]="${1#*\=}" shift done key="${1%:*}" -num="${${1##*:}:-1}" +if [[ $1 = *:* ]]; then + num=${1##*:} +else + num=1 +fi shift if zstyle -a ":completion:${curcontext}:$tag" "$style" tmp; then -- cgit 1.4.1