Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: "typeset -m" plays havoc



Don't try this:

zsh% splat() { typeset -m \* }
zsh% splat

The result is that all non-readonly/non-special parameters get stomped on,
which leaves zsh in a pretty sorry state.

The behavior up to 3.1.5 or so was that `-m' implied the equivalent of `-g',
so I think the following is the most expedient patch.  Peter?

Index: Src/builtin.c
===================================================================
@@ -1942,6 +1942,7 @@
 
     /* With the -m option, treat arguments as glob patterns */
     if (ops['m']) {
+	on &= ~PM_LOCAL;
 	while ((asg = getasg(*argv++))) {
 	    LinkList pmlist = newlinklist();
 	    LinkNode pmnode;

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author