From 555b95c5f39bb3221ad3a54e583ec643aa2ce516 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 22 Feb 2013 20:26:32 +0000 Subject: 31060:"+" before a flag for "functions" or "autoload" should suppress display of function body. --- Src/builtin.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Src/builtin.c') 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')) { -- cgit 1.4.1