-ash: changed behaviour of local vars / v1.22.1 -> v1.23.2
Eugene Rudoy
gene.devel at gmail.com
Thu Apr 16 21:15:58 UTC 2015
Hi,
@Bastian: see 109ee5d336, your example is however quite strange -
what's the reason for declaring the variable twice, what's the real
use-case?
@Denys: your commit-message states "bash does that". bash indeed does
so for the test-case from your commit, but doesn't do so for Bastians
example (tested with bash 4.1 & 4.3). I believe if the variable should
be unset should depend on its (variables) scope.
Best regards,
Gene
[109ee5d336] http://git.busybox.net/busybox/commit/shell?id=109ee5d33694a03cda3424b4846584250832ba8e
On Thu, Apr 16, 2015 at 8:57 PM, Bastian Bittorf <bittorf at bluebottle.com> wrote:
> while heavy testing of recent OpenWrt i
> discovered the following problem:
>
> x() { local x=1; echo $x; local x; echo $x; }
>
> older busybox will output
> 1
> 1
>
> and v1.23.2 will only output
> 1
>
> this means: 'local varname' will empty the var.
> is this a problem with a changed config? at least
> i cannot find a corresponding changeset regarding ash.c
>
> bye, bastian
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
More information about the busybox
mailing list