Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [bug] sh: tilde expansion after field splitting
- X-seq: zsh-workers 41814
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [bug] sh: tilde expansion after field splitting
- Date: Wed, 4 Oct 2017 22:24:50 -0700
- 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=QSt548jqMCtyy+wQPTSqMNwqpqOy9jccoLIZ2VdhHAE=; b=icHUjoaMFVbkHO3Ux4moksO6WKYniGv1GNIVqbO9//UhwZv4jUYUpr/DY7m0sC7o3k FO3ki3M+M3Bk7TR3/0PSdb1uFyEe1684wAtJxNZMHh4APQuqg0fanihoC2Ss5LF6Gxnl PjqtiJ4gnwz+hwI7lcvIBVi79kxxrBeOcGWpji/6i4LxBdBLm8+RrcPw7rYyLpJGZzCq FdTzHSKKruOLpsTsiOeNVcb+xt5XxykKYoSDAmVD+BOEkRk842HoSs6Yzj0lIGee2uAg vKDgYGOeCxg3ALpFrCmrhZTdqPxLnMnnRZaKT247bRhZNGxBE6KGsdmMq/tjGBMgTs+C L52Q==
- In-reply-to: <06fb6a91-6766-bbd7-9543-cbafe704ee59@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: <06fb6a91-6766-bbd7-9543-cbafe704ee59@inlv.org>
On Oct 5, 12:20am, Martijn Dekker wrote:
}
} 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.
This is a change in the effects of SH_FILE_EXPANSION when an array is
synthesized by word splitting.
Traced this to here:
diff --git a/Src/subst.c b/Src/subst.c
index 81d34d2..021d234 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3834,8 +3834,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
y = dupstring(nulstring);
insertlinknode(l, n, (void *) y), incnode(n);
}
- if (eval)
- n = on;
+ /* This used to omit restoring of *str and instead test
+ * if (eval)
+ * n = on;
+ * but that causes strange behavior of history modifiers when
+ * applied across all values of an array. What is magic about
+ * eval here that *str seemed not to need restoring?
+ */
+ *str = getdata(n = on);
} else {
/*
* Scalar value. Handle last minute transformations
Apparently the answer to the question in that comment has something to
do with shfileexpansion. Anyone have additional clues?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author