about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2014-11-28 13:30:22 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2014-11-28 13:30:22 -0800
commit49d6aace41f5fe47abfaa87d25c42dbdb84dfb88 (patch)
tree9628c722c2fd505b081c5e61bdb448bef172b5f9 /Src/exec.c
parent389954beec04f3019efa759ce92a4af85d24924e (diff)
downloadzsh-49d6aace41f5fe47abfaa87d25c42dbdb84dfb88.tar.gz
zsh-49d6aace41f5fe47abfaa87d25c42dbdb84dfb88.tar.xz
zsh-49d6aace41f5fe47abfaa87d25c42dbdb84dfb88.zip
33816, 33819: GLOB_ASSIGN changes integer and floating type variables to string scalars
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c10
1 files changed, 9 insertions, 1 deletions
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;