about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2000-05-28 21:10:13 +0000
committerBart Schaefer <barts@users.sourceforge.net>2000-05-28 21:10:13 +0000
commit7a3ca7a673d98fcbe50c192cba6165d17505e394 (patch)
tree8eb236b85172be8a250751a81e453fd01c63460c
parentb6cf1f330341afd5551b203123752ac1d2d98ed7 (diff)
downloadzsh-7a3ca7a673d98fcbe50c192cba6165d17505e394.tar.gz
zsh-7a3ca7a673d98fcbe50c192cba6165d17505e394.tar.xz
zsh-7a3ca7a673d98fcbe50c192cba6165d17505e394.zip
11618: Fix bad shift.
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Base/_arguments8
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 45e7122da..167f2e1dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-05-28  Bart Schaefer  <schaefer@zsh.org>
+
+	* 11618: Completion/Base/_arguments: Fix bad shift.
+
 2000-05-28  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
 	* 11616: Src/Modules/zftp.c: configure test for netinet/in_systm.h
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index b605605da..11c62705f 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -285,7 +285,7 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
 
               # Otherwise we call it with the description-arguments.
 
-              eval "action=( $action )"
+              set -A action ${=~action}
               while _next_label "$subc" expl "$descr"; do
                 "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
 	      done
@@ -293,9 +293,9 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
             fi
           fi
         fi
-        shift 1 descrs
-        shift 1 actions
-        shift 1 subcs
+        shift "${#descrs} ? 1 : 0" descrs
+        shift "${#actions} ? 1 : 0" actions
+        shift "${#subcs} ? 1 : 0" subcs
       done
 
       if [[ -z "$matched$hasopts" ]] && _requested options &&