summaryrefslogtreecommitdiff
path: root/subst.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-07 09:27:39 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-07 09:27:39 -0500
commitdd4f3dd8935364148647fb83cf1f9c846e7393aa (patch)
treebdbfaf890e1d25df416c5521b884bff0af6b9918 /subst.c
parent2e4498b3aaccbc2618e74f1101abafed96a6bf19 (diff)
downloadbash-dd4f3dd8935364148647fb83cf1f9c846e7393aa.tar.gz
commit bash-20080821 snapshot
Diffstat (limited to 'subst.c')
-rw-r--r--subst.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/subst.c b/subst.c
index 4ec73db2..11c7453d 100644
--- a/subst.c
+++ b/subst.c
@@ -5581,7 +5581,7 @@ verify_substring_values (v, value, substr, vtype, e1p, e2p)
#if defined (ARRAY_VARS)
/* For arrays, the second offset deals with the number of elements. */
if (vtype == VT_ARRAYVAR)
- len = array_num_elements (a);
+ len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a);
#endif
if (t)
@@ -5651,6 +5651,7 @@ get_var_and_type (varname, value, quoted, varp, valp)
{ /* [ */
if (ALL_ELEMENT_SUB (temp[0]) && temp[1] == ']')
{
+ /* Callers have to differentiate betwen indexed and associative */
vtype = VT_ARRAYVAR;
if (temp[0] == '*')
vtype |= VT_STARSUB;