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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 5b08d0bfb..45b58aef6 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1618,8 +1618,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 	opts[PROMPTPERCENT] = opp;
     }
     if (quotemod) {
-	if (--quotetype > 2)
-	    quotetype = 2;
+	if (--quotetype > 3)
+	    quotetype = 3;
 	if (isarr) {
 	    char **ap;
 
@@ -1628,7 +1628,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 	    ap = aval;
 
 	    if (quotemod > 0) {
-		if (quotetype) {
+		if (quotetype == 3)
+		    for (; *ap; ap++)
+			*ap = nicedupstring(*ap);
+		else if (quotetype) {
 		    int sl;
 		    char *tmp;
 
@@ -1665,7 +1668,9 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 	    if (!copied)
 		val = dupstring(val), copied = 1;
 	    if (quotemod > 0) {
-		if (quotetype) {
+		if (quotetype == 3)
+		    val = nicedupstring(val);
+		else if (quotetype) {
 		    int sl;
 		    char *tmp;