Commit ccb0bbd
committed
fix(interpreter): expand command substitutions in assoc array keys
Associative array assignments where the key is a command substitution
(e.g. m["$(echo hello)"]="world") silently produced an empty key.
Add async expand_assoc_key() that parses the subscript as a full Word
and expands it with expand_word() when it contains $( or backtick.
Closes #8721 parent 9752fe0 commit ccb0bbd
File tree
2 files changed
+26
-1
lines changed- crates/bashkit
- src/interpreter
- tests/spec_cases/bash
2 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3129 | 3129 | | |
3130 | 3130 | | |
3131 | 3131 | | |
3132 | | - | |
| 3132 | + | |
3133 | 3133 | | |
3134 | 3134 | | |
3135 | 3135 | | |
| |||
7791 | 7791 | | |
7792 | 7792 | | |
7793 | 7793 | | |
| 7794 | + | |
| 7795 | + | |
| 7796 | + | |
| 7797 | + | |
| 7798 | + | |
| 7799 | + | |
| 7800 | + | |
| 7801 | + | |
| 7802 | + | |
| 7803 | + | |
| 7804 | + | |
| 7805 | + | |
| 7806 | + | |
| 7807 | + | |
| 7808 | + | |
7794 | 7809 | | |
7795 | 7810 | | |
7796 | 7811 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
| |||
0 commit comments