Skip to content

Commit 4f0383b

Browse files
committed
patch 7.4.2076
Problem: Syntax error when dict has '>' key. Solution: Check for endchar. (Ken Takata)
1 parent c917da4 commit 4f0383b

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/testdir/test_lambda.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@ function Test_lambda_fails()
4646
call assert_fails('echo {a, a -> a + a}(1, 2)', 'E15:')
4747
call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:')
4848
endfunc
49+
50+
func Test_not_lamda()
51+
let x = {'>' : 'foo'}
52+
call assert_equal('foo', x['>'])
53+
endfunc

src/userfunc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ func_init()
150150
hash_init(&func_hashtab);
151151
}
152152

153-
/* Get function arguments. */
153+
/*
154+
* Get function arguments.
155+
*/
154156
static int
155157
get_function_args(
156158
char_u **argp,
@@ -232,7 +234,9 @@ get_function_args(
232234
break;
233235
}
234236
}
235-
++p; /* skip the ')' */
237+
if (*p != endchar)
238+
goto err_ret;
239+
++p; /* skip "endchar" */
236240

237241
*argp = p;
238242
return OK;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ static char *(features[]) =
758758

759759
static int included_patches[] =
760760
{ /* Add new patch number below this line */
761+
/**/
762+
2076,
761763
/**/
762764
2075,
763765
/**/

0 commit comments

Comments
 (0)