mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-11-13 10:21:31 +01:00
36083: set array value when consistently retying scalar and array
This commit is contained in:
parent
a07f74fadd
commit
6fa8708bfc
3 changed files with 10 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
||||||
|
2015-08-10 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||||
|
|
||||||
|
* 36083: Src/builtin.c, Test/B02typeset.ztst: set array value
|
||||||
|
when consistently retying scalar and array.
|
||||||
|
|
||||||
2015-08-10 Peter Stephenson <p.stephenson@samsung.com>
|
2015-08-10 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
* 36074: Src/signals.c: Don't rely on implicit value for
|
* 36074: Src/signals.c: Don't rely on implicit value for
|
||||||
|
|
|
||||||
|
|
@ -2685,6 +2685,8 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
|
||||||
tdp->joinchar = joinchar;
|
tdp->joinchar = joinchar;
|
||||||
if (asg0.value.scalar)
|
if (asg0.value.scalar)
|
||||||
setsparam(asg0.name, ztrdup(asg0.value.scalar));
|
setsparam(asg0.name, ztrdup(asg0.value.scalar));
|
||||||
|
else if (asg->value.array)
|
||||||
|
setaparam(asg->name, zlinklist2array(asg->value.array));
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
zwarnnam(name, "can't tie already tied scalar: %s",
|
zwarnnam(name, "can't tie already tied scalar: %s",
|
||||||
|
|
|
||||||
|
|
@ -467,9 +467,12 @@
|
||||||
print $tied_array
|
print $tied_array
|
||||||
typeset -T TIED_SCALAR=goo:car tied_array
|
typeset -T TIED_SCALAR=goo:car tied_array
|
||||||
print $tied_array
|
print $tied_array
|
||||||
|
typeset -T TIED_SCALAR tied_array=(poo par)
|
||||||
|
print $TIED_SCALAR
|
||||||
0:retying arrays to same array works
|
0:retying arrays to same array works
|
||||||
>foo bar
|
>foo bar
|
||||||
>goo car
|
>goo car
|
||||||
|
>poo:par
|
||||||
|
|
||||||
(
|
(
|
||||||
setopt POSIXBUILTINS
|
setopt POSIXBUILTINS
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue