Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pws-19: completion problem
- X-seq: zsh-workers 6322
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Re: pws-19: completion problem
- Date: Fri, 21 May 1999 09:14:22 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Thu, 20 May 1999 21:00:28 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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<TAB>
> 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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author