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

Re: A strange quoted nested evaluation issue



On Mon, 2018-11-19 at 12:39 -0600, dana wrote:
> On 19 Nov 2018, at 02:04, Ian F <in4mer@xxxxxxxxx> wrote:
> > 
> > Normally I wouldn't mail the list about this kind of thing, but this one's
> > just too weird.  Thoughts?
> It's counting a Nularg (0xa1). And it's not just a problem there; try e.g.
> "${(g<>)${baz}}" or "${(l<3><x>)${baz}}". Not sure where the best place to fix
> it is though

Right.

This, I think.

pws

diff --git a/Src/subst.c b/Src/subst.c
index c706b96..ff6750a 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2405,6 +2405,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 	    aspar = 0;
 	} else if (aspar)
 	    idbeg = val;
+	if (*val == Nularg)
+	    ++val;
 	*s = sav;
 	/*
 	 * This tests for the second double quote in an expression



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