From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10253 invoked from network); 21 May 1999 07:14:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 May 1999 07:14:30 -0000 Received: (qmail 29385 invoked by alias); 21 May 1999 07:14:24 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6322 Received: (qmail 29378 invoked from network); 21 May 1999 07:14:24 -0000 Date: Fri, 21 May 1999 09:14:22 +0200 (MET DST) Message-Id: <199905210714.JAA01215@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Thu, 20 May 1999 21:00:28 +0400 Subject: Re: pws-19: completion problem Andrej Borsenkow wrote: > bor@itsrm2:/tools/src/zsh-3.1.5-pws-19%> Src/zsh -f > itsrm2% cd Completion > itsrm2% fpath=($PWD/*) > itsrm2% source Core/compinit > itsrm2% cd .. > itsrm2% ./configure --pre=/to > itsrm2% ./configure --pre=/tools/ Whoa. This happened because ${${a}[(I)foo]} didn't work (with `a' being an array). Since multsub() now correctly reports arrays, another bug showed up. It went like this: multsub() found out the ${a} was an array and set *isarr=1. This was copied into the value struct in params.c:1073. Then getindex() was called, which called getarg() and that looked at v->isarr in params.c:82[68]. And since a value of 1 is the same as SCANPM_WANTVALS, it set *inv=0 which means that index-reporting was switched off. Then it did the matching, stored some number and later when the actual value was got, this resulted in the matched *string* (and not the index) being expanded. The patch below makes multsub() set isarr to SCANPM_MATCHMANY, which is the value used for array-parameters. I can only hope that there are no other places where this might cause problems. Bye Sven --- os/subst.c Thu May 20 08:32:39 1999 +++ Src/subst.c Fri May 21 09:02:48 1999 @@ -279,7 +279,7 @@ *p = NULL; if (a && mult_isarr) { *a = r; - *isarr = 1; + *isarr = SCANPM_MATCHMANY; mult_isarr = omi; return 0; } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de