On 2/28/14, 4:50 PM, NBaH wrote:
> Bash Version: 4.3
> Patch Level: 0
> Release Status: release
>
> Description:
>
> $ var="foo bar"
> $ declare -n nameref=var
> $ echo "${!nameref} = $nameref"
> var = foo bar
> $ test -R nameref && echo ok || echo ko
> bash: test: -R: unary operator expected
> ko
Thanks for the report. A line got dropped from a merge back during
development. I've attached a patch that fixes this and one other problem
with -R.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3/test.c 2014-02-04 16:52:58.000000000 -0500
--- test.c 2014-02-28 21:22:44.000000000 -0500
***************
*** 647,652 ****
case 'R':
! v = find_variable (arg);
! return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
}
--- 647,652 ----
case 'R':
! v = find_variable_noref (arg);
! return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
}
***************
*** 724,727 ****
--- 724,728 ----
case 'u': case 'v': case 'w': case 'x': case 'z':
case 'G': case 'L': case 'O': case 'S': case 'N':
+ case 'R':
return (1);
}