summary refs log tree commit diff
path: root/Completion/Base/Utility/_combination
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Utility/_combination')
-rw-r--r--Completion/Base/Utility/_combination12
1 files 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