zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [bug] sh: tilde expansion after field splitting
Date: Sun, 8 Oct 2017 20:20:32 +0100	[thread overview]
Message-ID: <20171008202032.11ea7bf9@ntlworld.com> (raw)
In-Reply-To: <171008005347.ZM1177@torch.brasslantern.com>

On Sun, 8 Oct 2017 00:53:46 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Oct 5, 12:20am, Martijn Dekker wrote:
> } Subject: [bug] sh: tilde expansion after field splitting
> }
> } POSIX says tilde expansion should be done before parameter expansion [...]
> } zsh did this correctly up to version 5.0.8; as of 5.1, it appears to do
> } tilde expansion *after* field splitting, and only from the second field on.
> 
> The patch below fixes this, I believe.

Good, it sounds like the effect of the chunk you previous identified as
related was simply moving the linked list node on as a side effect, or
something like that.

> - There either isn't a Test/ for the keyvalpairelement() case in the
>   first hunk below, or it isn't rigorous enough, because I initially
>   forgot the incnode(node) in that hunk, yet the shell did *not* go
>   into an infinite loop during "make check", nor did any test
>   fail

That doesn't make sense.  This is the only place where key / value pairs
are handled and they require some sort of loop increment to work at all.
You're basically claiming they only work by magic.

> - Should we be testing isset(SHFILEEXPANSION) directly here, or ought
>   it instead be [for example] passed in the flags?  Is it possible
>   that stringsubst() [second hunk] could toggle the setopt so that
>   the isset() in the third hunk inverts sense?  Of course if that IS
>   possible, then the ultimate effect might be the expected one, and
>   this point is moot.

I can't believe this is a big deal.

> - Grepping Test/* doesn't find anything for SH_FILE_EXPANSION (in
>   upper/lower, with/without underscores, etc.).  Did I miss it?
>   Does the test for the case in this thread belong in D04parameter
>   or E01options?

Assuming SH_FILE_EXPANSION predates the test suite, I wouldn't be
surprised if it's missing.

pws


  reply	other threads:[~2017-10-08 19:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 22:20 Martijn Dekker
2017-10-05  5:24 ` Bart Schaefer
2017-10-08  7:53 ` Bart Schaefer
2017-10-08 19:20   ` Peter Stephenson [this message]
2017-10-08 20:45     ` Bart Schaefer
2017-10-09  8:44       ` Peter Stephenson
2017-10-13  9:43   ` Martijn Dekker
2017-10-13 12:55     ` Peter Stephenson
2017-10-13 15:36       ` Bart Schaefer

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=20171008202032.11ea7bf9@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --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).