[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: declare checks on valid nameref names don't account for +=
From: |
Chet Ramey |
Subject: |
Re: declare checks on valid nameref names don't account for += |
Date: |
Wed, 25 May 2016 15:29:41 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 5/22/16 7:14 PM, Grisha Levit wrote:
> The following should probably work:
>
> |$ declare -n ref=var ref+=[@] bash: declare: [@]: invalid variable name for
> name reference |
>
> But the following should not:
>
> |$ declare -n ref=re ref+=f $ declare -p ref declare -n ref="ref" |
>
> The latter causes a segfault for export/readonly.
Thanks for the report. Both of these cases should be caught.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/