diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-04-01 22:08:54 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-04-01 22:08:54 +0200 |
commit | 7f3be402cecb458ac2a8d385bb7303d8b27f9af4 (patch) | |
tree | 3d74574688e990af2c4f46dcc1500d07a469ad5b /src/eval.c | |
parent | c7f025536e9e5b7b95b55d09094febb627395d05 (diff) | |
download | vim-7f3be402cecb458ac2a8d385bb7303d8b27f9af4.zip |
updated for version 7.4.236
Problem: It's not that easy to check the Vim patch version.
Solution: Make has("patch-7.4.123") work. (partly by Marc Weber)
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 |