From fa48711e31c4d45819455e767ad106c41f9a92fe Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 28 Aug 2016 19:12:17 -0700 Subject: 39115: repair forced joining when (@) and (j) are used together --- ChangeLog | 5 +++++ Src/subst.c | 5 +++-- Test/D04parameter.ztst | 9 +++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d9ac8133..8bc9372d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ * 39112: Completion/X/Command/_x_utils: Use state_descr +2016-08-28 Barton E. Schaefer + + * 39115: Src/subst.c, Test/D04parameter.ztst: repair forced + joining when (@) and (j) are used together (broken by 39019) + 2016-08-27 Daniel Shahaf * 39105: Completion/Unix/Type/_absolute_command_paths: diff --git a/Src/subst.c b/Src/subst.c index 15eb59b64..4641b4ba5 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -3458,7 +3458,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (ssub || spbreak || spsep || sep) { int force_split = !ssub && (spbreak || spsep); if (isarr) { - if (nojoin == 0) { + /* sep non-null here means F or j flag, force join */ + if (nojoin == 0 || sep) { val = sepjoin(aval, sep, 1); isarr = 0; ms_flags = 0; @@ -3467,7 +3468,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, * forced joining as previously determined, or * join on what we later use to forcibly split */ - val = sepjoin(aval, (nojoin == 1 ? sep : spsep), 1); + val = sepjoin(aval, (nojoin == 1 ? NULL : spsep), 1); isarr = 0; } } diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 37166fa21..063007956 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -1986,3 +1986,12 @@ >one >two-bucklemy >shoe + + ( + set -- "one two" "bucklemy shoe" + IFS= + setopt shwordsplit rcexpandparam + print -l "X${(@j.-.)*}" + ) +0:Use of @ does not prevent forced join with j +>Xone two-bucklemy shoe -- cgit 1.4.1