Commit f3e8f4cf authored by Barton E. Schaefer's avatar Barton E. Schaefer

35581, 35582: output array assignments with spaces inside the parens

parent e63065e8
2015-07-22 Barton E. Schaefer <schaefer@zsh.org>
* 35582: Test/A06assign.ztst, Test/B02typeset.ztst: test for 35581
* 35581: Src/params.c: output array assignments with spaces inside
the parens
2015-07-16 Barton E. Schaefer <schaefer@zsh.org>
* 35805: Test/E01options.ztst: tests for 35799
......
......@@ -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)
......
......@@ -430,7 +430,7 @@
0:GLOB_ASSIGN with numeric types
>typeset -i i=0
>typeset -a n
>n=(tmpfile1 tmpfile2)
>n=( tmpfile1 tmpfile2 )
>typeset x=tmpfile2
>typeset -E f=4.000000000e+00
......
......@@ -453,7 +453,7 @@
fn
1:declare -p shouldn't create scoped values
>typeset -a array
>array=(foo bar)
>array=( foo bar )
?fn:typeset: no such variable: nonexistent
unsetopt typesetsilent
......@@ -504,10 +504,10 @@
typeset -pm 'r[12]'
0:readonly -p output
>typeset -a a1
>a1=(one two)
>a1=( one two )
>typeset -ar a1
>typeset -a a2
>a2=(three four)
>a2=( three four )
>typeset -r r1=yes
>typeset -r r2=no
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment