On 3/18/14 5:36 AM, [email protected] wrote:
> Bash Version: 4.3
> Patch Level: 0
> Release Status: release
>
> Description:
> With an associative array, assoc, ${assoc[key]+set} expands to the
> empty string if the associated value is the empty string.
Thanks for the report. This was a consequence of a change made back in
2011 to expand the value portion of the assignment statement a slightly
different way. I've attached a patch to fix it.
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/arrayfunc.c 2013-08-02 16:19:59.000000000 -0400
--- arrayfunc.c 2014-03-18 11:08:15.000000000 -0400
***************
*** 598,601 ****
--- 598,606 ----
{
val = expand_assignment_string_to_string (val, 0);
+ if (val == 0)
+ {
+ val = (char *)xmalloc (1);
+ val[0] = '\0'; /* like do_assignment_internal */
+ }
free_val = 1;
}