about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 66e0bbe77..4e8ed721d 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -247,7 +247,10 @@ stringsubst(LinkList list, LinkNode node, int ssub, int asssub)
 	    if (endchar == Outpar && str2[1] == '(' && str[-2] == ')') {
 		/* Math substitution of the form $((...)) */
 		str[-2] = '\0';
-		str = arithsubst(str2 + 2, &str3, str);
+		if (isset(EXECOPT))
+		    str = arithsubst(str2 + 2, &str3, str);
+		else
+		    strncpy(str3, str2, 1);
 		setdata(node, (void *) str3);
 		continue;
 	    }