diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-12-07 09:27:39 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-12-07 09:27:39 -0500 |
commit | dd4f3dd8935364148647fb83cf1f9c846e7393aa (patch) | |
tree | bdbfaf890e1d25df416c5521b884bff0af6b9918 /subst.c | |
parent | 2e4498b3aaccbc2618e74f1101abafed96a6bf19 (diff) | |
download | bash-dd4f3dd8935364148647fb83cf1f9c846e7393aa.tar.gz |
commit bash-20080821 snapshot
Diffstat (limited to 'subst.c')
-rw-r--r-- | subst.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |