diff options
author | Kevin Ballard <kevin@sb.org> | 2014-08-28 13:19:38 -0700 |
---|---|---|
committer | Kevin Ballard <kevin@sb.org> | 2014-08-28 13:29:43 -0700 |
commit | b92a09d5e7e3334312265cc718c2d4d4dc687bb7 (patch) | |
tree | 8869607c92db25d8548ecda48ef381e9a005abac /po | |
parent | 02a07164f34462b8ce7c26594746ae587206a96e (diff) |
Fix the assertion failure in expand_variables()
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.
Diffstat (limited to 'po')
0 files changed, 0 insertions, 0 deletions