vim-patch:9.0.0057: has('patch-xxx') returns true

Problem:    has('patch-xxx') returns true.
Solution:   Check for digit. (closes vim/vim#10751)

5154a88800

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-11-29 09:04:05 -05:00
parent a950e8ea9d
commit 0d3ee26860
2 changed files with 2 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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()