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

Re: 5.4 almost released



On Tue, 8 Aug 2017 11:26:47 +0100
Martijn Dekker <martijn@xxxxxxxx> wrote:
> The recent POSIX_STRINGS-related change (41499, 2eacbef) introduced at
> least one serious bug. I think you should probably revert that commit
> before the 5.4 release so it can have more testing before 5.4.1 or
> whatever the release after this one is.

I'll probably back it off and make a 5.4.1 this evening as 5.4 is
already tagged.  Any fix will therefore be delayed until at least the
next full release (presumably 5.5).

> $* concatenated, IFS is space:
> 
>         emulate sh
>         set " abc " " def ghi " " jkl "
>         IFS=' '
>         set xx$*yy
> 	echo "$#,$1|$2|$3|$4|$5|$6"
> 
> Actual output: 5,xx|abc|def|ghi|jklyy|
> Expected output: 6,xx|abc|def|ghi|jkl|yy
> 
> The 'yy' is joined to the final 'jkl' instead of becoming a separate
> argument.

In other words, we are splitting on $* because that's the parameter we
are substituting, and performing any further processing on the result of
that, whereas in effect the rules want us to think of xx$1 ... ${N}yy as
arguments to be split (and the yy might itself be a further substitution).

I'm not sure we have a suitable level of expansion at which to fix this
up neatly, and cases like $*$x where $x is empty but we haven't expanded
it yet when we encounter $* are likely to be horrible.  I will therefore
probably leave the fix to someone who has more interest in POSIX tweaks.

pws



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