diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Src/builtin.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index 04a051add..afcb54c76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-02-22 Peter Stephenson <p.w.stephenson@ntlworld.com> + + * 31060: Src/builtin.c: "+" before a flag for "functions" or + "autoload" should suppress display of function body. + 2013-02-21 Oliver Kiddle <opk@zsh.org> * 31058: Completion/Zsh/Command/_fc, Completion/Unix/Command/_cut, @@ -532,5 +537,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5804 $ +* $Revision: 1.5805 $ ***************************************************** 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')) { |