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

Re: `We Love Sven' Day Celebrated In Pisa



Peter Stephenson wrote:

> Didn't we do this before?  Maybe I missed applying a patch (in which case
> everyone else will have missed out by now, because it was a couple of weeks
> ago):
> 
> % _foo() { local list='Hi mum!'; compgen -y '$list' -k '(foo bar)'; }
> % compdef _foo foo
> % foo ^D
> <lists rubbish>
> 
> It's OK if $list is not local.

We had this for arrays and then I only saw the array created in
get_user_var() for scalar parameters and... We have to copy the value, 
too, of course.

Bye
 Sven

--- os/Zle/zle_tricky.c	Wed Mar  3 09:03:29 1999
+++ Src/Zle/zle_tricky.c	Wed Mar  3 09:03:43 1999
@@ -6845,7 +6845,7 @@
 
 	if ((val = getsparam(nam))) {
 	    arr = (char **)ncalloc(2*sizeof(char *));
-	    arr[0] = val;
+	    arr[0] = (incompfunc ? dupstring(val) : val);
 	    arr[1] = NULL;
 	}
 	return arr;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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