Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: mult_isarr bug



Peter Stephenson wrote:

> Am I going crazy or is this bug still in the latest version of the shell?
> 
> % dirs
> ~z/Src ~z ~/lgt/rz2 ~ ~/lgt/tfuzz /temp/pws ~/lgt/su2/cxx ~/tex/hep-lat
> /temp/pws/src
> % print ${$(dirs)[1]}
> ~
> 
> Wasn't this just fixed?

Oops. No, we have only handled nested parameter expansions, yet.

The `fix' for the above would be something like the patch below which
makes the result of $(...) be treated as an array if the whole thing
is not quoted. I think this is the right behavior, yes?

Bye
 Sven

--- os/subst.c	Mon May 10 17:23:08 1999
+++ Src/subst.c	Fri May 14 08:40:41 1999
@@ -99,6 +99,8 @@
     while (!errflag && *str) {
 	if ((qt = *str == Qstring) || *str == String) {
 	    if (str[1] == Inpar) {
+		if (!qt)
+		    mult_isarr = 1;
 		str++;
 		goto comsub;
 	    } else if (str[1] == Inbrack) {
@@ -249,6 +251,7 @@
  * The mult_isarr variable is used by paramsubst() to tell if it yields *
  * an array.                                                            */
 
+/**/
 static int mult_isarr;
 
 /**/

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author