From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
Date: Mon, 8 Aug 2016 19:27:34 +0100 [thread overview]
Message-ID: <20160808192734.21923640@ntlworld.com> (raw)
In-Reply-To: <20160808111626.GA19766@chaz.gmail.com>
On Mon, 8 Aug 2016 12:16:26 +0100
Stephaneo Chazelas <stephane.chazelas@gmail.com> wrote:
> It looks like the elements of $@ only undergo splitting when $#
> is 1:
>
> ~$ zsh -o shwordsplit -c 'IFS=:; echo $@' zsh a:b
> a b
> ~$ zsh -o shwordsplit -c 'IFS=:; echo $@' zsh a:b c
> a:b c
The variable isarr from the value entry v->isarr is negative, so we
don't go into the loop that does joining and splitting as that
explicitly asks for (isarr >= 0). (It was 0 for a scalar, hence the
first case above.)
Setting this negative is apparently deliberate:
/* "$foo[@]"-style substitution
* Only sign bit is significant
*/
#define SCANPM_ISVAR_AT ((int)(((unsigned int)-1)<<15))
This seems to conflict with the use of isarr in paramsubst(); that's
documented but I think only because I tried to decode the code. I don't
know what this SCANPM_ISVAR_AT is doing. Perhaps it needs converting to
something else at some point?
pws
next prev parent reply other threads:[~2016-08-08 18:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 11:16 Stephane Chazelas
2016-08-08 17:28 ` Bart Schaefer
2016-08-08 18:02 ` Jérémie Roquet
2016-08-08 18:27 ` Peter Stephenson [this message]
2016-08-09 1:21 ` Bart Schaefer
2016-08-09 8:40 ` Peter Stephenson
2016-08-10 17:28 ` Bart Schaefer
2016-08-11 10:05 ` Peter Stephenson
2016-08-11 17:28 ` Bart Schaefer
2016-08-12 7:50 ` Bart Schaefer
2016-08-10 12:56 ` Peter Stephenson
2016-08-11 0:39 ` 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=20160808192734.21923640@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).