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

Re: PATCH: small parameter fix



I wrote:

> With the patch below we get:
> 
>   % echo ${$(uname -n)[1]}
>   beta
>   % echo "${$(uname -n)[1]}"
>   b
>   % echo ${${path}[1]}
>   /users/wischnow/bin/alpha
>   % echo "${${path}[1]}"
>   /
> 
> ...which seems sensible to me.

Grrr, this broke "${(@)$(foo)#...}" where the manual says that the
thing inside will be treated as an array if the `(@)' flags is given.

The patch at least fixes this. But maybe we should collect opinions
which expression should expand to what and then make the code produce
that.


Bye
 Sven

--- os/subst.c	Tue Mar  9 11:07:25 1999
+++ Src/subst.c	Tue Mar  9 11:10:13 1999
@@ -976,7 +976,8 @@
 	skipparens(*s, *s == Inpar ? Outpar : Outbrace, &s);
 	sav = *s;
 	*s = 0;
-	if (multsub(&val, ((quoted || aspar) ? NULL : &aval), &isarr, NULL) &&
+	if (multsub(&val, (((quoted || aspar) && !nojoin) ? NULL : &aval),
+		    &isarr, NULL) &&
 	    quoted) {
 	    isarr = -1;
 	    aval = alloc(sizeof(char *));

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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