about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 74059bfdc..ef3e85948 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3493,8 +3493,13 @@ execcmd(Estate state, int input, int output, int how, int last1)
 
 			DPUTS(wc_code(ac) != WC_ASSIGN,
 			      "BUG: bad assignment list for typeset");
-			if (htok)
-			    untokenize(name);
+			if (htok) {
+			    init_list1(svl, name);
+			    prefork(&svl, PREFORK_SINGLE);
+			    name= empty(&svl) ? "" :
+				(char *)getdata(firstnode(&svl));
+			}
+			untokenize(name);
 			asg->name = name;
 			if (WC_ASSIGN_TYPE(ac) == WC_ASSIGN_SCALAR) {
 			    char *val = ecgetstr(state, EC_DUPTOK, &htok);