Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] SHWORDSPLIT: unset IFS: $* and $@ don't split
- X-seq: zsh-workers 40593
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Martijn Dekker <martijn@xxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] SHWORDSPLIT: unset IFS: $* and $@ don't split
- Date: Sun, 19 Feb 2017 16:49:50 -0800
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=brasslantern-com.20150623.gappssmtp.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=IqBMlq8zsu02Iulx3TBUDiP0sCyDJFTD+YFJKIAvIDU=; b=1JSbbHxzvB+G3tnXxcrejCuXXywFR15wJkgQzNvGQIu/21zBESxxMAWgMaknVf65k1 Rru9aYt6i+ZpVY7wip4GlL1MJjSDfB8rQGpa5Xhi0yyzITYthYBD9X45PD5+3U7+jQil 7nK5IOB1OKGeSBfXbYoxQkpX144LAbaFf6IlCxynbPZKMPTcu2aSSAxKdqtKTwz/XWCy /+5hjBxN4MWscUPVpdhp+uXFtkqJMk6pKJvza7UNREftihjgh+EmuTyeqLPP8J30A19X 4dDyTXWTaosM9IJA5/7hCEhChIk8JNVuuy8/+bRFFm6elez//DF2MBpx316o2/M7sUc6 BYcw==
- In-reply-to: <9196b7e6-2a81-37c1-c22a-e66754ea73a3@inlv.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author