about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-12-04 15:39:53 +0000
committerPeter Stephenson <pws@zsh.org>2015-12-04 15:39:53 +0000
commit16684952fbea39879dcbd4356c8d20acad4912b0 (patch)
tree1fb75f0b8378bfd11f558ced8440200128bf6de9 /Src/params.c
parentdc8c39efffd67c42ad5c630d892928a85a92dfca (diff)
downloadzsh-16684952fbea39879dcbd4356c8d20acad4912b0.tar.gz
zsh-16684952fbea39879dcbd4356c8d20acad4912b0.tar.xz
zsh-16684952fbea39879dcbd4356c8d20acad4912b0.zip
37305: typeset -p can now output arrays on one line
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/Src/params.c b/Src/params.c
index aed72d447..8cab96983 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -5182,9 +5182,6 @@ printparamvalue(Param p, int printflags)
     }
     if (printflags & PRINT_KV_PAIR)
 	putchar(' ');
-    else if ((printflags & PRINT_TYPESET) &&
-	     (PM_TYPE(p->node.flags) == PM_ARRAY || PM_TYPE(p->node.flags) == PM_HASHED))
-	printf("%s=", p->node.nam);
     else
 	putchar('=');
 
@@ -5255,7 +5252,6 @@ mod_export void
 printparamnode(HashNode hn, int printflags)
 {
     Param p = (Param) hn;
-    int array_typeset;
 
     if (p->node.flags & PM_UNSET) {
 	if (isset(POSIXBUILTINS) && (p->node.flags & PM_READONLY) &&
@@ -5280,28 +5276,8 @@ printparamnode(HashNode hn, int printflags)
 	     */
 	    return;
 	}
-	/*
-	 * Printing the value of array: this needs to be on
-	 * a separate line so more care is required.
-	 */
-	array_typeset = (PM_TYPE(p->node.flags) == PM_ARRAY ||
-			 PM_TYPE(p->node.flags) == PM_HASHED) &&
-	    !(printflags & PRINT_NAMEONLY);
-	if (array_typeset && (p->node.flags & PM_READONLY)) {
-	    /*
-	     * We need to create the array before making it
-	     * readonly.
-	     */
-	    printf("typeset -a ");
-	    zputs(p->node.nam, stdout);
-	    putchar('\n');
-	    printparamvalue(p, printflags);
-	    printflags |= PRINT_NAMEONLY;
-	}
 	printf("typeset ");
     }
-    else
-	array_typeset = 0;
 
     /* Print the attributes of the parameter */
     if (printflags & (PRINT_TYPE|PRINT_TYPESET)) {
@@ -5349,8 +5325,6 @@ printparamnode(HashNode hn, int printflags)
     } else {
 	quotedzputs(p->node.nam, stdout);
 
-	if (array_typeset)
-	    putchar('\n');
 	printparamvalue(p, printflags);
     }
 }