Re: Bug with -o posix, local variables and assignment preceding builtins
From:
Crestez Dan Leonard
Subject:
Re: Bug with -o posix, local variables and assignment preceding builtins
Date:
Wed, 10 Feb 2010 12:25:18 +0200
On Mon, 2010-02-08 at 17:38 -0500, Chet Ramey wrote:
> On 2/7/10 8:33 PM, Crestez Dan Leonard wrote:
> > We encountered a strange bug while working on bash-completion. I was
> > originally only able to reproduce this through a fairly elaborate setup
> > but Freddy Vulto <fvulto@gmail.com> found a tiny test case:
> >
> > set -o posix
> > t() {
> > local x
> > BAR=a eval true
> > }
> > BAR=b; t; echo $BAR
> >
> > Bash documentation claims the following (section 6.11 point 23):
>
> See if the attached patch does the trick.
>
> Chet
Yes, it now works correctly. I tested both the simple example above and
my initial testing setup.