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

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

https://github.com/vim/vim/commit/5154a8880034b7bb94186d37bcecc6ee1a96f732

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund LazoandBram Moolenaar committed 2025-11-29 10:31:14 -05:00
1 parent a950e8ea9d
commit 0d3ee26860
2 files changed
+2 -1

No files matched your search

+1 -1
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) {
+1
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()