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

Re: PATCH: new parameter flag?



Peter Stephenson wrote:

> I suspect there may be an untokenization problem in the new parameter
> flags, or is the following expected for some reason?
> 
> % print ${(%):-%~}       
> 
> % print "${(%):-%~}"
> /temp/pws/zsh-beta/Src

Oops. Yes, two untokenize()s missing.

> (by the way, is it supposed to work like that without a parameter name, or
> is it just coincidence, because it's quite convenient?)

I've made it work on the final result because I wanted to be able to
do just this (and I expect it will be used often together with `(%)'.).

Bye
 Sven

--- os/subst.c	Wed Sep  1 09:25:20 1999
+++ Src/subst.c	Wed Sep  1 11:29:03 1999
@@ -1674,6 +1674,7 @@
 	    ap = aval;
 	    for (; *ap; ap++) {
 		unmetafy(*ap, &len);
+		untokenize(*ap);
 		*ap = unmetafy(promptexpand(metafy(*ap, len, META_NOALLOC),
 					    0, NULL, NULL), &len);
 	    }
@@ -1681,6 +1682,7 @@
 	    if (!copied)
 		val = dupstring(val), copied = 1;
 	    unmetafy(val, &len);
+	    untokenize(val);
 	    val = unmetafy(promptexpand(metafy(val, len, META_NOALLOC),
 					0, NULL, NULL), &len);
 	}

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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