To: vim_dev@googlegroups.com Subject: Patch 7.4.237 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.237 (after 7.4.236) Problem: When some patches was not included has("patch-7.4.123") may return true falsely. Solution: Check for the specific patch number. Files: runtime/doc/eval.txt, src/eval.c *** ../vim-7.4.236/runtime/doc/eval.txt 2014-04-01 22:08:51.008677463 +0200 --- runtime/doc/eval.txt 2014-04-02 12:09:35.991983552 +0200 *************** *** 1681,1687 **** is 501. Read-only. "version" also works, for backwards compatibility. Use |has()| to check if a certain patch was included, e.g.: > ! if has("patch123") < Note that patch numbers are specific to the version, thus both version 5.0 and 5.1 may have a patch 123, but these are completely different. --- 1682,1688 ---- is 501. Read-only. "version" also works, for backwards compatibility. Use |has()| to check if a certain patch was included, e.g.: > ! if has("patch-7.4.123") < Note that patch numbers are specific to the version, thus both version 5.0 and 5.1 may have a patch 123, but these are completely different. *************** *** 6397,6415 **** < *has-patch* 3. Included patches. The "patch123" feature means that patch 123 has been included. Note that this form does not check the version of Vim, you need ! to inspect |v:version| for that: Example (checking version 6.2.148 or later): > :if v:version > 602 || v:version == 602 && has("patch148") < Note that it's possible for patch 147 to be omitted even though 148 is included. ! 4. Beyond a certain patch level. The "patch-7.4.123" feature means that ! the Vim version is 7.4 and patch 123 or later was included, or the Vim ! version is later than 7.4. The example above can be simplified to: > :if has("patch-6.2.148") ! < Note that this does not check if the patch was actually included, some ! patches may have been skipped. That is unusual though. acl Compiled with |ACL| support. all_builtin_terms Compiled with all builtin terminals enabled. --- 6410,6428 ---- < *has-patch* 3. Included patches. The "patch123" feature means that patch 123 has been included. Note that this form does not check the version of Vim, you need ! to inspect |v:version| for that. Example (checking version 6.2.148 or later): > :if v:version > 602 || v:version == 602 && has("patch148") < Note that it's possible for patch 147 to be omitted even though 148 is included. ! 4. Beyond a certain version or at a certain version and including a specific ! patch. The "patch-7.4.123" feature means that the Vim version is 7.5 or ! later, or it is version 7.4 and patch 123 was included. The example above can be simplified to: > :if has("patch-6.2.148") ! < Note that it's possible for patch 147 to be omitted even though 148 is ! included. acl Compiled with |ACL| support. all_builtin_terms Compiled with all builtin terminals enabled. *** ../vim-7.4.236/src/eval.c 2014-04-01 22:08:51.016677463 +0200 --- src/eval.c 2014-04-02 12:04:41.179987607 +0200 *************** *** 12647,12660 **** { 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)); --- 12647,12659 ---- { int major = atoi((char *)name + 6); int minor = atoi((char *)name + 8); /* Expect "patch-9.9.01234". */ n = (major < VIM_VERSION_MAJOR || (major == VIM_VERSION_MAJOR && (minor < VIM_VERSION_MINOR || (minor == VIM_VERSION_MINOR ! && has_patch(atoi((char *)name + 10)))))); } else n = has_patch(atoi((char *)name + 5)); *** ../vim-7.4.236/src/version.c 2014-04-01 22:08:51.016677463 +0200 --- src/version.c 2014-04-02 12:10:48.911982549 +0200 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 237, /**/ -- hundred-and-one symptoms of being an internet addict: 22. You've already visited all the links at Yahoo and you're halfway through Lycos. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///