mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Pass the character index, not the character, to parse_util_expand_variable_error
Fixes #2067
This commit is contained in:
parent
cec1dc2095
commit
534fd1a59e
4 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -28,3 +28,6 @@ fish: echo ()[1]
|
|||
Invalid index value
|
||||
fish: echo ()[d]
|
||||
^
|
||||
$) is not a valid variable in fish.
|
||||
fish: echo $$paren
|
||||
^
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -40,3 +40,4 @@
|
|||
0
|
||||
1
|
||||
0
|
||||
Catch your breath
|
||||
|
|
Loading…
Reference in a new issue