about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-11-05 13:01:56 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-11-05 13:01:56 +0000
commit60b410fd7c709f0332355a0b013e92461d3e07ec (patch)
treeabea909b3f4f4d39db3e12a0adbdf0bb0a19b5d7
parent2a4c8c27c600671a4352e4a8f737ca81465af7af (diff)
downloadzsh-60b410fd7c709f0332355a0b013e92461d3e07ec.tar.gz
zsh-60b410fd7c709f0332355a0b013e92461d3e07ec.tar.xz
zsh-60b410fd7c709f0332355a0b013e92461d3e07ec.zip
"typeset -g <var>" should be silent even without TYPESET_SILENT
-rw-r--r--ChangeLog5
-rw-r--r--Src/builtin.c3
-rw-r--r--Test/B02typeset.ztst6
3 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ade3636f..8dc573359 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-05  Peter Stephenson  <pws@csr.com>
+
+	* 26008, Src/builtin.c, Test/B02typeset.ztst: "typeset -g
+	<var...>" should be silent even if TYPESET_SILENT is not set.
+
 2008-11-04  Peter Stephenson  <pws@csr.com>
 
 	* 26006: Test/C05debug.ztst: remove dependence on system
diff --git a/Src/builtin.c b/Src/builtin.c
index b6cd9610d..0748eaccc 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -1951,7 +1951,8 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
 	if (!on && !roff && !value) {
 	    if (OPT_ISSET(ops,'p'))
 		paramtab->printnode(&pm->node, PRINT_TYPESET);
-	    else if (unset(TYPESETSILENT) || OPT_ISSET(ops,'m'))
+	    else if (!OPT_ISSET(ops,'g') &&
+		     (unset(TYPESETSILENT) || OPT_ISSET(ops,'m')))
 		paramtab->printnode(&pm->node, PRINT_INCLUDEVALUE);
 	    return pm;
 	}
diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst
index 48a45c15d..7a9928abe 100644
--- a/Test/B02typeset.ztst
+++ b/Test/B02typeset.ztst
@@ -453,3 +453,9 @@
 >typeset -a array
 >array=(foo bar)
 ?fn:typeset: no such variable: nonexistent
+
+ unsetopt typesetsilent
+ silent1(){ typeset -g silence; }
+ silent2(){ local silence; silent1; }
+ silent2
+0:typeset -g should be silent even without TYPESET_SILENT