about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c22
-rw-r--r--Src/exec.c1
2 files changed, 22 insertions, 1 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 6cccf5330..5eb7bfb45 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -443,6 +443,28 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn)
 	        fputc(' ', xtrerr);
 	        quotedzputs(*fullargv++, xtrerr);
 	    }
+	    if (assigns) {
+		LinkNode node;
+		for (node = firstnode(assigns); node; incnode(node)) {
+		    Asgment asg = (Asgment)node;
+		    fputc(' ', xtrerr);
+		    quotedzputs(asg->name, xtrerr);
+		    if (asg->is_array) {
+			LinkNode arrnode;
+			fprintf(xtrerr, "=(");
+			for (arrnode = firstnode(asg->value.array);
+			     arrnode;
+			     incnode(arrnode)) {
+			    fputc(' ', xtrerr);
+			    quotedzputs((char *)getdata(arrnode), xtrerr);
+			}
+			fprintf(xtrerr, " )");
+		    } else if (asg->value.scalar) {
+			fputc('=', xtrerr);
+			quotedzputs(asg->value.scalar, xtrerr);
+		    }
+		}
+	    }
 	    fputc('\n', xtrerr);
 	    fflush(xtrerr);
 	}
diff --git a/Src/exec.c b/Src/exec.c
index 967f86e23..6066d5525 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3488,7 +3488,6 @@ execcmd(Estate state, int input, int output, int how, int last1)
 			wordcode ac = *state->pc++;
 			char *name = ecgetstr(state, EC_DUPTOK, &htok);
 			Asgment asg;
-			int htok;
 			local_list1(svl);
 
 			DPUTS(wc_code(ac) != WC_ASSIGN,