summaryrefslogtreecommitdiff
path: root/Src/builtin.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2013-02-22 20:26:32 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2013-02-22 20:26:32 +0000
commit555b95c5f39bb3221ad3a54e583ec643aa2ce516 (patch)
treed3805bf7c88c508bf9601bfaad5c6b82881c65b9 /Src/builtin.c
parenta409dbf74c5b0b11fb0d642dd0f5a48ee1f531ba (diff)
downloadzsh-555b95c5f39bb3221ad3a54e583ec643aa2ce516.tar.gz
zsh-555b95c5f39bb3221ad3a54e583ec643aa2ce516.zip
31060:"+" before a flag for "functions" or
"autoload" should suppress display of function body.
Diffstat (limited to 'Src/builtin.c')
-rw-r--r--Src/builtin.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index f13167f33..d91c2d944 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2680,7 +2680,7 @@ bin_functions(char *name, char **argv, Options ops, int func)
Patprog pprog;
Shfunc shf;
int i, returnval = 0;
- int on = 0, off = 0, pflags = 0;
+ int on = 0, off = 0, pflags = 0, roff;
/* Do we have any flags defined? */
if (OPT_PLUS(ops,'u'))
@@ -2699,16 +2699,21 @@ bin_functions(char *name, char **argv, Options ops, int func)
on |= PM_TAGGED_LOCAL;
else if (OPT_PLUS(ops,'T'))
off |= PM_TAGGED_LOCAL;
+ roff = off;
if (OPT_MINUS(ops,'z')) {
on |= PM_ZSHSTORED;
off |= PM_KSHSTORED;
- } else if (OPT_PLUS(ops,'z'))
+ } else if (OPT_PLUS(ops,'z')) {
off |= PM_ZSHSTORED;
+ roff |= PM_ZSHSTORED;
+ }
if (OPT_MINUS(ops,'k')) {
on |= PM_KSHSTORED;
off |= PM_ZSHSTORED;
- } else if (OPT_PLUS(ops,'k'))
+ } else if (OPT_PLUS(ops,'k')) {
off |= PM_KSHSTORED;
+ roff |= PM_KSHSTORED;
+ }
if ((off & PM_UNDEFINED) || (OPT_ISSET(ops,'k') && OPT_ISSET(ops,'z')) ||
(OPT_MINUS(ops,'X') && (OPT_ISSET(ops,'m') || *argv || !scriptname))) {
@@ -2716,7 +2721,7 @@ bin_functions(char *name, char **argv, Options ops, int func)
return 1;
}
- if (OPT_PLUS(ops,'f') || OPT_ISSET(ops,'+'))
+ if (OPT_PLUS(ops,'f') || roff || OPT_ISSET(ops,'+'))
pflags |= PRINT_NAMEONLY;
if (OPT_MINUS(ops,'M') || OPT_PLUS(ops,'M')) {