* PATCH: GLOB_ASSIGN only affects scalar assignments
[not found] <556D9EBE.4050702@gmail.com>
@ 2015-06-02 13:35 ` Mikael Magnusson
0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2015-06-02 13:35 UTC (permalink / raw)
To: zsh-workers
---
isstr is set to (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR) a bit above this.
Previously, when setopt globassign was in effect, this would happen,
% typeset -A foo
% foo=(*)
% echo ${(t)foo}
array
when it should still say association, this is what caused _lastcomp to
change type and break completion.
Src/exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Src/exec.c b/Src/exec.c
index 007447d..2e996d4 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2264,14 +2264,14 @@ addvars(Estate state, Wordcode pc, int addflags)
state->pc = opc;
return;
}
- if (!isstr || (isset(GLOBASSIGN) &&
+ if (!isstr || (isset(GLOBASSIGN) && isstr &&
haswilds((char *)getdata(firstnode(vl)), 0))) {
globlist(vl, 0);
/* Unset the parameter to force it to be recreated
* as either scalar or array depending on how many
* matches were found for the glob.
*/
- if (isset(GLOBASSIGN))
+ if (isset(GLOBASSIGN) && isstr)
unsetparam(name);
}
if (errflag) {
--
2.4.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-02 13:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <556D9EBE.4050702@gmail.com>
2015-06-02 13:35 ` PATCH: GLOB_ASSIGN only affects scalar assignments Mikael Magnusson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).