Re: [PATCH] fix for loop assignments to nameref control vars

2017-02-22 Thread Chet Ramey
On 2/22/17 6:47 AM, Grisha Levit wrote: > The special-case handling of namerefs as for loop control variables is > missing checks for the readonly attribute on the nameref and allows > creation of forbidden nameref self-references. Thanks for the report and fix. Chet -- ``The lyf so short, the c

[PATCH] fix for loop assignments to nameref control vars

2017-02-22 Thread Grisha Levit
The special-case handling of namerefs as for loop control variables is missing checks for the readonly attribute on the nameref and allows creation of forbidden nameref self-references. $ declare -rn ref=a $ for ref in b; { :; } $ declare -p ref declare -nr ref="b" $ declare -n ref $ for ref in r