zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Martijn Dekker <martijn@inlv.org>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: 5.4 almost released
Date: Tue, 08 Aug 2017 12:00:46 +0100	[thread overview]
Message-ID: <20170808120046.1cc8c36d@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <9581a3ad-bdf9-18cb-dc84-9d6fb34e93d5@inlv.org>

On Tue, 8 Aug 2017 11:26:47 +0100
Martijn Dekker <martijn@inlv.org> 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


  reply	other threads:[~2017-08-08 11:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170807135641epcas3p4bc0a64f832ae7fcd76051ac198722045@epcas3p4.samsung.com>
2017-08-07 13:55 ` parsing empty alternatives: case foo|) :;; Daniel Shahaf
2017-08-07 14:26   ` Peter Stephenson
2017-08-07 14:44     ` Bart Schaefer
2017-08-07 14:58       ` Peter Stephenson
2017-08-07 18:03         ` 5.4 almost released Peter Stephenson
2017-08-07 18:25           ` Eric Cook
2017-08-07 18:34             ` Peter Stephenson
2017-08-08 10:26               ` Martijn Dekker
2017-08-08 11:00                 ` Peter Stephenson [this message]
2017-08-07 18:21         ` parsing empty alternatives: case foo|) :;; Peter Stephenson
2017-08-07 18:56           ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170808120046.1cc8c36d@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=martijn@inlv.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).