summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-07-22 12:43:09 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2015-07-22 12:43:09 -0700
commitf3e8f4cf7a68a1e0e4356fc0f7e419ada338a3e0 (patch)
tree3ebca086e5e7ba373caf1750f2805ba5ba47cabc /Src/params.c
parente63065e8e58069de8ea7a18a3830ef5b0f4f45f7 (diff)
downloadzsh-f3e8f4cf7a68a1e0e4356fc0f7e419ada338a3e0.tar.gz
zsh-f3e8f4cf7a68a1e0e4356fc0f7e419ada338a3e0.tar.xz
zsh-f3e8f4cf7a68a1e0e4356fc0f7e419ada338a3e0.zip
35581, 35582: output array assignments with spaces inside the parens
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c
index 7d0c8525e..312fa9ae1 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -5099,8 +5099,10 @@ printparamvalue(Param p, int printflags)
 	break;
     case PM_ARRAY:
 	/* array */
-	if (!(printflags & PRINT_KV_PAIR))
+	if (!(printflags & PRINT_KV_PAIR)) {
 	    putchar('(');
+	    putchar(' ');
+	}
 	u = p->gsu.a->getfn(p);
 	if(*u) {
 	    quotedzputs(*u++, stdout);
@@ -5109,13 +5111,17 @@ printparamvalue(Param p, int printflags)
 		quotedzputs(*u++, stdout);
 	    }
 	}
-	if (!(printflags & PRINT_KV_PAIR))
+	if (!(printflags & PRINT_KV_PAIR)) {
+	    putchar(' ');
 	    putchar(')');
+	}
 	break;
     case PM_HASHED:
 	/* association */
-	if (!(printflags & PRINT_KV_PAIR))
+	if (!(printflags & PRINT_KV_PAIR)) {
 	    putchar('(');
+	    putchar(' ');
+	}
 	{
             HashTable ht = p->gsu.h->getfn(p);
             if (ht)