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

List:       bash-bug
Subject:    Re: Empty array referenced by indirection reports unbound variable
From:       konsolebox <konsolebox () gmail ! com>
Date:       2021-12-30 16:57:14
Message-ID: CAJnmqwbEWgJ3n+mBFdYkQqtrsweZr+eeemPaw7D=rnBnTz6=5A () mail ! gmail ! com
[Download RAW message or body]

On Thu, Dec 30, 2021 at 4:35 PM Chet Ramey <chet.ramey@case.edu> wrote:
>
> On 12/27/21 11:37 PM, konsolebox wrote:
> > On Thu, Apr 8, 2021, 06:56 konsolebox, <konsolebox@gmail.com
> > <mailto:konsolebox@gmail.com>> wrote:
> >
> >     On Thu, Apr 8, 2021 at 2:44 AM Chet Ramey <chet.ramey@case.edu
> >     <mailto:chet.ramey@case.edu>> wrote:
> >      > Indirection does not check whether or not the variable it's indirecting
> >      > is $@/$* or ${array[@/*]}. It simply goes by the return value.
> >
> >     It looks like it can easily be fixed with this:
>
> Let's try it. Thanks for the report.

Thank you very much.  This will finally make `set -u` a completely
reliable function.  If I recall correctly, having want_indir set means
the indirection parameter is already valid, so there's no need to test
for other name-validity checks and go straight to checking the
indirected value.  Anyhow I've been using the patch since April and
have `set -u` set globally and I haven't had any issues related to it
since.


-- 
konsolebox


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

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