On 1 July 2015 at 21:43, Gavin Smith <[email protected]> wrote:
>
> I seem to remember there was something wrong about the "local"
> function, but I can't remember what it was.
This test for "local" is flawed:
(
foo=bar
test_local () {
local foo=foo
}
test_local >/dev/null 2>&1
test $foo = bar
) || eval '
local () {
case $1 in
*=*) eval "$1";;
esac
}
'
It appears to assume that "local foo=foo" will assign "foo" to foo if
local doesn't exist, but in fact all it does is print an error
message, and leave foo as was.