commit bash-20180126 snapshot

This commit is contained in:
Chet Ramey
2018-01-29 08:55:47 -05:00
parent e7e095ceb3
commit 661f4c20c3
10 changed files with 99 additions and 20 deletions
+8 -1
View File
@@ -902,16 +902,23 @@ valid_array_reference (name, flags)
*t = '[';
if (r == 0)
return 0;
/* Check for a properly-terminated non-blank subscript. */
/* Check for a properly-terminated non-null subscript. */
len = skipsubscript (t, 0, flags);
if (t[len] != ']' || len == 1)
return 0;
if (t[len+1] != '\0')
return 0;
#if 1
/* Could check and allow subscripts consisting only of whitespace for
existing associative arrays. */
for (r = 1; r < len; r++)
if (whitespace (t[r]) == 0)
return 1;
return 0;
#else
/* This allows blank subscripts */
return 1;
#endif
}
return 0;
}