diff options
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index 65419cb36..042afca36 100644 --- a/src/eval.c +++ b/src/eval.c @@ -12638,7 +12638,27 @@ f_has(argvars, rettv) if (n == FALSE) { if (STRNICMP(name, "patch", 5) == 0) - n = has_patch(atoi((char *)name + 5)); + { + if (name[5] == '-' + && STRLEN(name) > 11 + && vim_isdigit(name[6]) + && vim_isdigit(name[8]) + && vim_isdigit(name[10])) + { + int major = atoi((char *)name + 6); + int minor = atoi((char *)name + 8); + int patch = atoi((char *)name + 10); + + /* Expect "patch-9.9.01234". */ + n = (major < VIM_VERSION_MAJOR + || (major == VIM_VERSION_MAJOR + && (minor < VIM_VERSION_MINOR + || (minor == VIM_VERSION_MINOR + && patch <= highest_patch())))); + } + else + n = has_patch(atoi((char *)name + 5)); + } else if (STRICMP(name, "vim_starting") == 0) n = (starting != 0); #ifdef FEAT_MBYTE |