From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5297 invoked from network); 22 May 2000 18:13:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 May 2000 18:13:43 -0000 Received: (qmail 26946 invoked by alias); 22 May 2000 18:13:30 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11517 Received: (qmail 26939 invoked from network); 22 May 2000 18:13:29 -0000 Message-ID: <39297892.9878595A@u.genie.co.uk> Date: Mon, 22 May 2000 19:12:34 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.73 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: _next_label losing empty arguments Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Firstly, thanks Bart for the _arguments fix - that solved my problem. I was just looking at putting the "$@"s back in to _urls on the _next_label lines and things were not working as I hoped. The problem occurred where I used a -S '' because _next_labels was losing the '' argument when sticking them in the expl array. Is the use of set in this patch instead of eval safe? I tried to answer this myself and the following behaviour doesn't seem right: > set -A a - 1 2 3 > echo $#a 4 > echo $a[1] Surely, a[1] should not be empty: it should either be '-' or we should use the ksh behaviour (the array would contain just 1,2 and 3). Oliver Index: Completion/Core/_next_label =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_next_label,v retrieving revision 1.2 diff -u -r1.2 _next_label --- Completion/Core/_next_label 2000/04/11 07:57:57 1.2 +++ Completion/Core/_next_label 2000/05/22 18:11:31 @@ -13,10 +13,10 @@ zformat -f descr "${curtag#*:}" "d:$3" _description "$gopt" "${curtag%:*}" "$2" "$descr" curtag="${curtag%:*}" - eval "${2}=( \${(P)2} \$argv[4,-1] )" + set -A $2 "${(P@)2}" "${argv[4,-1][@]}" else _description "$gopt" "$curtag" "$2" "$3" - eval "${2}=( \$argv[4,-1] \${(P)2} )" + set -A $2 "${argv[4,-1][@]}" "${(P@)2}" fi return 0