summaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2020-11-17 14:18:49 -0500
committerChet Ramey <chet.ramey@case.edu>2020-11-17 14:18:49 -0500
commit37b22abee700eb1b0c5b6926ab32630a429c1183 (patch)
tree01d22efef9babf0127776b6b3c4387b03dc629ab /test.c
parent278db80c368700ed6117fbd390c89a9b44c0240c (diff)
downloadbash-5.1-testing.tar.gz
Bash-5.1-rc3 releasebash-5.1-rc3bash-5.1-testing
Diffstat (limited to 'test.c')
-rw-r--r--test.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/test.c b/test.c
index ed1d3ffc..e2fd78b3 100644
--- a/test.c
+++ b/test.c
@@ -627,8 +627,11 @@ unary_test (op, arg)
if (valid_array_reference (arg, 0))
{
char *t;
- int rtype, ret;
- t = array_value (arg, 0, 0, &rtype, (arrayind_t *)0);
+ int rtype, ret, flags;
+
+ /* Let's assume that this has already been expanded once. */
+ flags = assoc_expand_once ? AV_NOEXPAND : 0;
+ t = array_value (arg, 0, flags, &rtype, (arrayind_t *)0);
ret = t ? TRUE : FALSE;
if (rtype > 0) /* subscript is * or @ */
free (t);