Skip to content

Commit 5154a88

Browse files
committed
patch 9.0.0057: has('patch-xxx') returns true
Problem: has('patch-xxx') returns true. Solution: Check for digit. (closes #10751)
1 parent bd683e3 commit 5154a88

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6473,7 +6473,7 @@ f_has(typval_T *argvars, typval_T *rettv)
64736473
|| (minor == VIM_VERSION_MINOR
64746474
&& has_patch(atoi((char *)name + 10))))));
64756475
}
6476-
else
6476+
else if (isdigit(name[5]))
64776477
n = has_patch(atoi((char *)name + 5));
64786478
}
64796479
else if (STRICMP(name, "vim_starting") == 0)

src/testdir/test_expr.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func Test_version()
4141
call assert_false(has('patch-7.4.'))
4242
call assert_false(has('patch-9.1.0'))
4343
call assert_false(has('patch-9.9.1'))
44+
call assert_false(has('patch-abc'))
4445
endfunc
4546

4647
func Test_op_ternary()

src/version.c

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

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
57,
738740
/**/
739741
56,
740742
/**/

0 commit comments

Comments
 (0)