1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-25 17:20:25 +02:00

Fix retying variables in opposite order.

Now gives an error.
Add test.
This commit is contained in:
Peter Stephenson 2015-08-09 19:10:01 +01:00
parent 249999cfb4
commit 17d52d69ec
3 changed files with 11 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2015-08-09 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 26027: Src/builtin.c: fix retying variables in opposite
order (should be an error).
* 36025:Src/Zle/zle_tricky.c: Catch another case of context in
get_comp_string(): after "foo=bar; setopt " we didn't recognise
"setopt" as the command. Attempt to do this without actually

View file

@ -2674,7 +2674,9 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
&& (locallevel == pm->level || !(on & PM_LOCAL))) {
if (pm->node.flags & PM_TIED) {
unqueue_signals();
if (!strcmp(asg->name, pm->ename)) {
if (PM_TYPE(pm->node.flags) != PM_SCALAR) {
zwarnnam(name, "already tied as non-scalar: %s", asg0.name);
} else if (!strcmp(asg->name, pm->ename)) {
/*
* Already tied in the fashion requested.
*/

View file

@ -1069,6 +1069,11 @@
>a:b a b
>x:y:z
typeset -T tied1 tied2 +
typeset -T tied2 tied1 +
1:Attempts to swap tied variables are safe but futile
?(eval):typeset:2: already tied as non-scalar: tied2
string='look for a match in here'
if [[ ${string%%(#b)(match)*} = "look for a " ]]; then
print $match[1] $mbegin[1] $mend[1] $string[$mbegin[1],$mend[1]]