summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-09-14 21:43:37 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-09-14 21:43:37 +0100
commitab7be4238ca89b5dca482a1c3b3fd013b105750e (patch)
treed22e18887769a111c1e6597f6bd33dc136439e55 /Src
parent7ca2e97c14cd7927c1ee688880884a2bd152fc68 (diff)
downloadzsh-ab7be4238ca89b5dca482a1c3b3fd013b105750e.tar.gz
zsh-ab7be4238ca89b5dca482a1c3b3fd013b105750e.tar.xz
zsh-ab7be4238ca89b5dca482a1c3b3fd013b105750e.zip
More [key]=value tweaks
Some rephrasings.

Update typeset -p for associative arrays to use new syntax.
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Src/params.c b/Src/params.c
index e0aaaf620..d628ddf37 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -5564,9 +5564,7 @@ printparamvalue(Param p, int printflags)
 {
     char *t, **u;
 
-    if (printflags & PRINT_KV_PAIR)
-	putchar(' ');
-    else
+    if (!(printflags & PRINT_KV_PAIR))
 	putchar('=');
 
     /* How the value is displayed depends *
@@ -5721,7 +5719,11 @@ printparamnode(HashNode hn, int printflags)
 	zputs(p->node.nam, stdout);
 	putchar('\n');
     } else {
+	if (printflags & PRINT_KV_PAIR)
+	    putchar('[');
 	quotedzputs(p->node.nam, stdout);
+	if (printflags & PRINT_KV_PAIR)
+	    printf("]=");
 
 	printparamvalue(p, printflags);
     }