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

Re: [PATCH 1/2] Consolidated nofork substitution changes



The substitution ${ cmd args} has a problem with multi-byte
characters.

$ LC_ALL=en_US.UTF-8 zsh -f
% echo -n à | od -t x1
0000000    c3  a0                                                        
0000002
% echo -n ${ echo -n à} | od -t x1
0000000    c3  5c                                                        
000000

Maybe the following?
(I will not push this by myself even if it's a correct fix.)


diff --git a/Src/subst.c b/Src/subst.c
index dc2052ee0..65ae44c3f 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2006,7 +2006,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 		int onoerrs = noerrs;
 		noerrs = 2;
 		if ((cmdarg = ztuff(rplytmp)))
-		    setsparam("REPLY", cmdarg);
+		    setsparam("REPLY", metafy(cmdarg, -1, META_HREALLOC));
 		noerrs = onoerrs;
 	    }
 	}






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