diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2000-09-17 05:38:36 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2000-09-17 05:38:36 +0000 |
commit | bd7969bfa568c91ee1875d62fda663c7468c030d (patch) | |
tree | 4dc4840aee672e0ae92e0304e1429e8805a597c8 /Src | |
parent | abd9b6d820822389ff3d5aedd01e76e159eab226 (diff) | |
download | zsh-bd7969bfa568c91ee1875d62fda663c7468c030d.tar.gz zsh-bd7969bfa568c91ee1875d62fda663c7468c030d.tar.xz zsh-bd7969bfa568c91ee1875d62fda663c7468c030d.zip |
"typeset +m ..." and "typeset +g -m ..."
Diffstat (limited to 'Src')
-rw-r--r-- | Src/builtin.c | 13 |
1 files changed, 11 insertions, 2 deletions
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. |