Pass the character index, not the character, to parse_util_expand_variable_error

Fixes #2067
This commit is contained in:
ridiculousfish 2015-05-15 17:10:29 -07:00
parent cec1dc2095
commit 534fd1a59e
4 changed files with 9 additions and 1 deletions

View file

@ -1034,7 +1034,7 @@ static int expand_variables(parser_t &parser, const wcstring &instr, std::vector
{
if (errors)
{
parse_util_expand_variable_error(instr, 0 /* global_token_pos */, c, errors);
parse_util_expand_variable_error(instr, 0 /* global_token_pos */, i, errors);
}
is_ok = false;

View file

@ -28,3 +28,6 @@ fish: echo ()[1]
Invalid index value
fish: echo ()[d]
^
$) is not a valid variable in fish.
fish: echo $$paren
^

View file

@ -81,6 +81,10 @@ echo $foo[d]
echo ()[1]
echo ()[d]
echo "Catch your breath"
set paren ')'
echo $$paren
# Test tilde expansion
# On OS X, /tmp is symlinked to /private/tmp
# $PWD is our best bet for resolving it

View file

@ -40,3 +40,4 @@
0
1
0
Catch your breath