Re: parameter expansion assignment to array index nameref

2023-04-10 Thread Chet Ramey
On 4/6/23 4:20 PM, Grisha Levit wrote: $ declare -n ref=arr[1] $ arr=(A); (echo "${ref=X} ${ref}") A X $ arr=( ); (echo "${ref=X} ${ref}") Segmentation fault: 11 Expanding the nameref while still in parameter_brace_expand seems to do the right thing though I can't say I'm fully confident in this

parameter expansion assignment to array index nameref

2023-04-06 Thread Grisha Levit
$ declare -n ref=arr[1] $ arr=(A); (echo "${ref=X} ${ref}") A X $ arr=( ); (echo "${ref=X} ${ref}") Segmentation fault: 11 Expanding the nameref while still in parameter_brace_expand seems to do the right thing though I can't say I'm fully confident in this. diff --git a/subst.c b/subst.c index 5