[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-tech
Subject:    Re: Fix assigning array variables in ksh
From:       Vadim Zhukov <persgray () gmail ! com>
Date:       2021-03-05 15:18:06
Message-ID: CAMy=nGH7pWmtZAc3j4V4twPYFE5f2HuD-wKgWomMG0gkiNEfrQ () mail ! gmail ! com
[Download RAW message or body]

пт, 5 мар. 2021 г. в 18:14, Theo Buehler <tb@theobuehler.org>:
>
> On Sun, Feb 21, 2021 at 10:04:07PM +0300, Vadim Zhukov wrote:
> > Hello all.
> >
> > This continues the 'Another potential ksh bug?' thread on misc@:
> > https://marc.info/?l=openbsd-misc&m=160736700220621&w=2
> > This present is a bit too late for Christmas, but at least the Day of
> > Red Army is coming soon. I'm sure noone is against this patch then.
> >
> > The code in typeset() function, which is responsible for almost all
> > shell variable tweaking, contains a bug: in case of array it passes
> > "foo=var" instead of only variable name ("foo"), if the value was
> > ever given. This results in, e.g., a bug reported by Jordan Geoghegan.
> > Generally speaking, we had creating a (temporary) variable via global()
> > in vpbase, and of course it didn't get the read-only marker.
> >
> > This fix is to use 'tvar' variable, which always contains shell
> > variable name, without value.
>
> ok tb
>
> > As a bonus, this fixes the ifs.t:IFS-null-1 test (previously failing).
> > I'm too lazy to check why. :-)
>
> I'm confused. I have 11 failing tests before and after your patch.
> Also IFS-null-1 has been passing for a long time.

Hm-m-m. Probably something in my environment... I'll experiment separately then.

Thanks!

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic