mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-01 05:16:05 +01:00
unposted: fix printf -v to an array without format string reuse
This commit is contained in:
parent
85ba685813
commit
ee1222454e
3 changed files with 13 additions and 2 deletions
|
@ -1,4 +1,9 @@
|
|||
2016-11-21 Oliver Kiddle <okiddle@yahoo.co.uk>
|
||||
2016-11-23 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* unposted: Src/builtin.c, Test/B03print.ztst: fix printf -v
|
||||
to an array without format string reuse
|
||||
|
||||
2016-11-21 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 39993: Test/Y01completion.ztst: Tests for 39981.
|
||||
|
||||
|
|
|
@ -5034,7 +5034,7 @@ bin_print(char *name, char **args, Options ops, int func)
|
|||
if (buf)
|
||||
free(buf);
|
||||
} else {
|
||||
if (visarr) {
|
||||
if (visarr && splits) {
|
||||
char **arrayval = zshcalloc((cursplit - splits + 2) * sizeof(char *));
|
||||
for (;cursplit >= splits; cursplit--) {
|
||||
int start = cursplit == splits ? 0 : cursplit[-1];
|
||||
|
|
|
@ -316,3 +316,9 @@
|
|||
typeset -p foo
|
||||
0:printf into an array variable
|
||||
>typeset -a foo=( '1 one' '2 two' '3 three' )
|
||||
|
||||
typeset -a foo
|
||||
print -f '%s' -v foo string
|
||||
typeset -p foo
|
||||
0:printf to an array variable without format string reuse
|
||||
>typeset foo=string
|
||||
|
|
Loading…
Reference in a new issue