mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-25 10:11:17 -03:00
expand_variables() is slightly confused about how to handle last_idx. On input, it expects it to be the index to start processing at, but when called recursively it always passes the current index. This means that it may sometimes pass an index 1 past the end of the input string. Notably, that happens when typing something like > echo "$foo (where "foo" is any string that is not a prefix of some existing variable name) Fix this by explicitly defining last_idx as being the last processed index, meaning the next index to process is actually last_idx-1. This means we should call it with next.size() instead of next.size()-1.
61 KiB
61 KiB