From 49d6aace41f5fe47abfaa87d25c42dbdb84dfb88 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Fri, 28 Nov 2014 13:30:22 -0800 Subject: 33816, 33819: GLOB_ASSIGN changes integer and floating type variables to string scalars --- Src/exec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 02a8fe3ad..2b7c55f8f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -2243,8 +2243,16 @@ addvars(Estate state, Wordcode pc, int addflags) state->pc = opc; return; } - if (isset(GLOBASSIGN) || !isstr) + if (!isstr || (isset(GLOBASSIGN) && + 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)) + unsetparam(name); + } if (errflag) { state->pc = opc; return; -- cgit 1.4.1