From bd7969bfa568c91ee1875d62fda663c7468c030d Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Sun, 17 Sep 2000 05:38:36 +0000 Subject: "typeset +m ..." and "typeset +g -m ..." --- Src/builtin.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Src') diff --git a/Src/builtin.c b/Src/builtin.c index 742527e00..c62664e26 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -1858,7 +1858,7 @@ bin_typeset(char *name, char **argv, char *ops, int func) return 0; } - if ((!ops['g'] && !ops['x']) || ops['g'] == 2 || *name == 'l' || + if (!(ops['g'] || ops['x'] || ops['m']) || ops['g'] == 2 || *name == 'l' || !isset(GLOBALEXPORT)) on |= PM_LOCAL; @@ -1942,7 +1942,11 @@ bin_typeset(char *name, char **argv, char *ops, int func) /* With the -m option, treat arguments as glob patterns */ if (ops['m']) { - on &= ~PM_LOCAL; + if (!(on|roff)) + printflags |= PRINT_TYPE; + if (!on) + printflags |= PRINT_NAMEONLY; + while ((asg = getasg(*argv++))) { LinkList pmlist = newlinklist(); LinkNode pmnode; @@ -1954,6 +1958,11 @@ bin_typeset(char *name, char **argv, char *ops, int func) returnval = 1; continue; } + if (ops['m'] == 2 && !asg->value) { + scanmatchtable(paramtab, pprog, on|roff, 0, + paramtab->printnode, printflags); + continue; + } /* * Search through the parameter table and change all parameters * matching the glob pattern to have these flags and/or value. -- cgit 1.4.1