bug-bash
[Top][All Lists]
Advanced

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

Re: declare checks on valid nameref names don't account for +=


From: Grisha Levit
Subject: Re: declare checks on valid nameref names don't account for +=
Date: Tue, 31 May 2016 14:08:01 -0400

On Wed, May 25, 2016 at 3:29 PM, Chet Ramey <address@hidden> wrote:


Thanks for the report.  Both of these cases should be caught

Is it deliberate that with the latest changes a faulty += RHS causes an existing valid nameref to be unset?

$ declare -n ref=re
$ declare -n ref+=f
bash: ref: nameref variable self references not allowed
$ declare -p ref
bash: declare: ref: not found 

$ declare -n ref=X
$ declare -n ref+=/
bash: declare: `/': not a valid identifier
$ declare -p ref
bash: declare: ref: not found

Also, this still seems to miss some stuff that would normally be caught:

$ declare -n ref=ref[0]
bash: declare: ref: nameref variable self references not allowed
$ declare -n ref=re ref+=f[0]
$ declare -p ref
declare -n ref="ref[0]"

reply via email to

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