Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: GLOB_ASSIGN only affects scalar assignments
- X-seq: zsh-workers 35365
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: GLOB_ASSIGN only affects scalar assignments
- Date: Tue, 2 Jun 2015 15:35:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=2VZL9NOo+6e7g9P6/Qzxa9vaNXZZRkY3zn1FG2Bzp9w=; b=eZQYyvyjhKd1q83A7TOGo0zjON9DOSiIcgcHShth7kH7YKjQdHSxCwmSK2y5Sw9vZB FUF0EfIfFp2sLWFydJwUJ5cxrupAi3jAANYeQyWXtm31cxR8kFHfKuoqu/45bNgJlnW8 Ewz7NtSHtFc8cJD6xEpvcpGxqxPbNFa5KeWLmwCoRiVzPLosdnkUAfYeTYYEmXJHgZOo ba5LSp8j2jY/PXpAOyJopArumrWGpBFLHtGJZD8hQo6SoROKpnK9c37pkHwO7Jz/wbCT x6E+YUBcltrFIQdllJ2GcBSyzyr2AlKTSSIf8oFBg3dpE11PXHcbSDqSCZAc+p+PC+wJ q8uw==
- In-reply-to: <556D9EBE.4050702@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <556D9EBE.4050702@gmail.com>
---
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author