commit bash-20120831 snapshot

This commit is contained in:
Chet Ramey
2012-09-13 11:55:04 -04:00
parent df0e4bfe75
commit a7ad477fe7
58 changed files with 67921 additions and 22187 deletions
+9
View File
@@ -305,6 +305,9 @@ assign_array_element_internal (entry, name, vname, sub, sublen, value, flags)
else
{
ind = array_expand_index (entry, sub, sublen);
/* negative subscripts to indexed arrays count back from end */
if (ind < 0)
ind = array_max_index (array_cell (entry)) + 1 + ind;
if (ind < 0)
{
err_badarraysub (name);
@@ -542,6 +545,9 @@ assign_compound_array_list (var, nlist, flags)
if (array_p (var))
{
ind = array_expand_index (var, w + 1, len);
/* negative subscripts to indexed arrays count back from end */
if (ind < 0)
ind = array_max_index (array_cell (var)) + 1 + ind;
if (ind < 0)
{
err_badarraysub (w);
@@ -742,6 +748,9 @@ unbind_array_element (var, sub)
else
{
ind = array_expand_index (var, sub, len+1);
/* negative subscripts to indexed arrays count back from end */
if (ind < 0)
ind = array_max_index (array_cell (var)) + 1 + ind;
if (ind < 0)
{
builtin_error ("[%s]: %s", sub, _(bash_badsub_errmsg));