about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c2
-rw-r--r--Src/params.c3
-rw-r--r--Src/zsh.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 950595c72..8ea88862f 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1598,7 +1598,7 @@ typeset_single(char *cname, char *pname, Param pm, int func,
     if (usepm) {
 	on &= ~PM_LOCAL;
 	if (!on && !roff && !value) {
-	    paramtab->printnode((HashNode)pm, 0);
+	    paramtab->printnode((HashNode)pm, PRINT_INCLUDEVALUE);
 	    return pm;
 	}
 	if ((pm->flags & PM_RESTRICTED) && isset(RESTRICTED)) {
diff --git a/Src/params.c b/Src/params.c
index f57173495..2768c273d 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3181,7 +3181,8 @@ printparamnode(HashNode hn, int printflags)
 	    printf("exported ");
     }
 
-    if ((printflags & PRINT_NAMEONLY) || (p->flags & PM_HIDEVAL)) {
+    if ((printflags & PRINT_NAMEONLY) ||
+	((p->flags & PM_HIDEVAL) && !(printflags & PRINT_INCLUDEVALUE))) {
 	zputs(p->nam, stdout);
 	putchar('\n');
 	return;
diff --git a/Src/zsh.h b/Src/zsh.h
index 49f434691..d4f521f48 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1213,6 +1213,7 @@ struct nameddir {
 #define PRINT_TYPE		(1<<1)
 #define PRINT_LIST		(1<<2)
 #define PRINT_KV_PAIR		(1<<3)
+#define PRINT_INCLUDEVALUE	(1<<4)
 
 /* flags for printing for the whence builtin */
 #define PRINT_WHENCE_CSH	(1<<4)