commit 0d3ee26860923e4be9f0a969b472a6ffaef4c83a
parent a950e8ea9d38ab2e75f7341aea44c865b211584e
Author: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
Date: Sat, 29 Nov 2025 09:04:05 -0500
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>
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git 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
@@ -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()