bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: param expansion with single-character special vars in the environmen


From: Piotr Grzybowski
Subject: Re: param expansion with single-character special vars in the environment
Date: Thu, 28 Apr 2016 08:32:44 +0200

On 28 Apr 2016, at 02:36, Grisha Levit wrote:

> 
> On Wed, Apr 27, 2016 at 6:47 PM, Piotr Grzybowski <address@hidden> wrote:
> +             if (v == 0 && onref || ( onref && !legal_identifier(value)))
> 
> Shouldn't this (and the other patch) check valid_array_reference as well to 
> support declare -n ref=a[x] ?

 yes most certainly should, and also should do a bit more.
 frankly, your original report:

readonly TMOUT=5; ref=$TMOUT; declare -n ref; ref=10; declare -n TMOUT; read

really scares me. The fix should also go to the nameref code, since I refuse to 
sanction the apparent entry in the variable table with name="5" and value="10" 
after this code is run, just by the fact that $TMOUT value is not a valid 
identifier.

cheers,
pg





reply via email to

[Prev in Thread] Current Thread [Next in Thread]