1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-20 06:56:05 +02:00

35694: fix handling of history modifiers applied across all elements of an array parameter value

This commit is contained in:
Barton E. Schaefer 2015-07-06 12:02:36 -07:00
parent 68a5a5f453
commit a9add3de54
3 changed files with 27 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2015-07-06 Barton E. Schaefer <schaefer@zsh.org>
* unposted: Doc/Zsh/expn.yo: alphabetize ${(b)...} flag
* 35709: Doc/Zsh/expn.yo: explain :s/// modifier contexts
* 35694: Src/subst.c, Test/D04parameter.ztst: fix handling of
history modifiers (specifically :s/l/r/) when applied across all
elements of an array parameter value
2015-07-06 Oliver Kiddle <opk@zsh.org>
* 35704: Doc/Zsh/compwid.yo, Src/Zle/compcore.c, Src/Zle/complete.c;

View File

@ -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

View File

@ -1711,3 +1711,12 @@
0:Avoid confusion after overloaded characters in braceless substitution in sh
>13
>0-1
a="aaa bab cac"
b=d
echo $a:gs/a/${b}/
a=(aaa bab cac)
echo $a:gs/a/${b}/
0:History modifier works the same for scalar and array substitution
>ddd bdb cdc
>ddd bdb cdc