diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index d2114ed3c4..e7b0e2bd7b 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2813,7 +2813,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) && (minor < VIM_VERSION_MINOR || (minor == VIM_VERSION_MINOR && has_vim_patch(atoi(name + 10)))))); - } else { + } else if (ascii_isdigit(name[5])) { n = has_vim_patch(atoi(name + 5)); } } else if (STRNICMP(name, "nvim-", 5) == 0) { diff --git a/test/old/testdir/test_expr.vim b/test/old/testdir/test_expr.vim index 81023ef92f..c62dc9845d 100644 --- a/test/old/testdir/test_expr.vim +++ b/test/old/testdir/test_expr.vim @@ -43,6 +43,7 @@ func Test_version() call assert_false(has('patch-7.4.')) call assert_false(has('patch-9.1.0')) call assert_false(has('patch-9.9.1')) + call assert_false(has('patch-abc')) endfunc func Test_op_ternary()