From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4753 invoked from network); 28 May 2000 20:53:02 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 May 2000 20:53:02 -0000 Received: (qmail 12430 invoked by alias); 28 May 2000 20:52:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11618 Received: (qmail 12423 invoked from network); 28 May 2000 20:52:49 -0000 From: "Bart Schaefer" Message-Id: <1000528205243.ZM28260@candle.brasslantern.com> Date: Sun, 28 May 2000 20:52:43 +0000 In-Reply-To: <393158CD.C9142475@u.genie.co.uk> Comments: In reply to Oliver Kiddle "PATCH: use _arguments in _which and _unhash" (May 28, 6:35pm) References: <393158CD.C9142475@u.genie.co.uk> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: PATCH: _arguments (Re: PATCH: use _arguments in _which and _unhash) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 28, 6:35pm, Oliver Kiddle wrote: } Subject: PATCH: use _arguments in _which and _unhash } } Bart Schaefer wrote: } } > } % zpty -w l } > } _arguments:shift:297: shift count must be <= $# } > } > I can't reproduce that. } } Are you sure? I can reproduce it on different platforms and when } starting with zsh -f. Maybe one of your options avoids it. Yup, you're right, I can reproduce it with -f. Is there a more efficient fix than the following? (This relies on the first argument of shift being interpreted as a math expression.) Index: Completion/Base/_arguments =================================================================== @@ -285,7 +285,7 @@ # 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 @@ 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 && -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net