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

Re: [bug] sh: tilde expansion after field splitting



On Sun, 8 Oct 2017 00:53:46 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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



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