From 4dc4e23376888697234e00e0c34184bb308886e1 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 2 Jun 2015 15:33:07 +0200 Subject: GLOB_ASSIGN should only affect scalar assignments --- ChangeLog | 5 +++++ Src/exec.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1767c78ce..acb367b83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-06-02 Mikael Magnusson + + * 35365: Src/exec.c: GLOB_ASSIGN should only affect scalar + assignments, this regressed in 33816. + 2015-06-02 Peter Stephenson * users/20243: Completion/compinit: turn off GLOB_ASSIGN in diff --git a/Src/exec.c b/Src/exec.c index 9f163a627..daed3b111 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))))) { 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) { -- cgit 1.4.1