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

Nasty bug in array-element typeset assignments



Change `foo' to a special such as `path' in the `oops' function below,
and you get a lovely core dump.  The `local' expression actually changes
the scope of the existing variable!

zagzig% functions oops
oops () {
        local 'foo[1]'=X
        echo $foo
}
zagzig% foo=({0..10})
zagzig% echo $foo
0 1 2 3 4 5 6 7 8 9 10
zagzig% oops
X 1 2 3 4 5 6 7 8 9 10
zagzig% echo $+foo
0

-- 
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