about summary refs log tree commit diff
diff options
context:
space:
mode:
-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