zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Martijn Dekker <martijn@inlv.org>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [BUG] SHWORDSPLIT: unset IFS: $* and $@ don't split
Date: Sun, 19 Feb 2017 16:49:50 -0800	[thread overview]
Message-ID: <170219164950.ZM26785@torch.brasslantern.com> (raw)
In-Reply-To: <9196b7e6-2a81-37c1-c22a-e66754ea73a3@inlv.org>

On Feb 19,  6:45am, Martijn Dekker wrote:
} Subject: [BUG] SHWORDSPLIT: unset IFS: $* and $@ don't split
}
} In SHWORDSPLIT mode, if IFS is unset (meaning we expect default field
} splitting),  unquoted $* and $@ (including in substitutions like
} ${1+$@}) or ${var-$*} do not perform the expected default field
} splitting after generating fields from the positional parameters.

This one turns out to be more tractible.

diff --git a/Src/subst.c b/Src/subst.c
index 670f3f0..1c2397c 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3476,7 +3476,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 		val = sepjoin(aval, sep, 1);
 		isarr = 0;
 		ms_flags = 0;
-	    } else if (force_split && (spsep || nojoin == 2)) {
+	    } else if (force_split &&
+		       (spsep || nojoin == 2 || (!ifs && isarr < 0))) {
 		/* Hack to simulate splitting individual elements:
 		 * forced joining as previously determined, or
 		 * join on what we later use to forcibly split


      reply	other threads:[~2017-02-20  0:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19  5:45 Martijn Dekker
2017-02-20  0:49 ` Bart Schaefer [this message]

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=170219164950.ZM26785@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).