about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-12-17 17:17:38 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-12-17 17:17:38 +0000
commit52b8303537015f603f35351abe2a01d8779868fe (patch)
treed5a16605b10781a3924555f089390f4c7bd27ddc /Src/exec.c
parent8659013fb8c76fdaac1baa43b09393ec10948a93 (diff)
downloadzsh-52b8303537015f603f35351abe2a01d8779868fe.tar.gz
zsh-52b8303537015f603f35351abe2a01d8779868fe.tar.xz
zsh-52b8303537015f603f35351abe2a01d8779868fe.zip
16353: add += parameter assignments
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Src/exec.c b/Src/exec.c
index ed8293b24..e7b57967b 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1512,7 +1512,8 @@ addvars(Estate state, Wordcode pc, int export)
 	if (htok)
 	    untokenize(name);
 	if (xtr)
-	    fprintf(xtrerr, "%s=", name);
+	    fprintf(xtrerr,
+	    	WC_ASSIGN_TYPE2(ac) == WC_ASSIGN_INC ? "%s+=" : "%s=", name);
 	if ((isstr = (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR))) {
 	    init_list1(svl, ecgetstr(state, EC_DUPTOK, &htok));
 	    vl = &svl;
@@ -1561,10 +1562,12 @@ addvars(Estate state, Wordcode pc, int export)
 		}
 		allexp = opts[ALLEXPORT];
 		opts[ALLEXPORT] = 1;
-		pm = setsparam(name, val);
+	    	pm = assignsparam(name, val,
+		    WC_ASSIGN_TYPE2(ac) == WC_ASSIGN_INC);
 		opts[ALLEXPORT] = allexp;
 	    } else
-		pm = setsparam(name, val);
+	    	pm = assignsparam(name, val,
+		    WC_ASSIGN_TYPE2(ac) == WC_ASSIGN_INC);
 	    if (errflag) {
 		state->pc = opc;
 		return;
@@ -1587,7 +1590,7 @@ addvars(Estate state, Wordcode pc, int export)
 		fprintf(xtrerr, "%s ", *ptr);
 	    fprintf(xtrerr, ") ");
 	}
-	setaparam(name, arr);
+	assignaparam(name, arr, WC_ASSIGN_TYPE2(ac) == WC_ASSIGN_INC);
 	if (errflag) {
 	    state->pc = opc;
 	    return;