changeset 5786:71b165a378ad v7.4.237

updated for version 7.4.237 Problem: When some patches was not included has("patch-7.4.123") may return true falsely. Solution: Check for the specific patch number.
author Bram Moolenaar <bram@vim.org>
date Wed, 02 Apr 2014 12:12:08 +0200
parents 050bc8c257cb
children 3a368abed51c
files runtime/doc/eval.txt src/eval.c src/version.c
diffstat 3 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1682,7 +1682,7 @@ v:version	Version number of Vim: Major v
 		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")
+			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.
--- a/src/eval.c
+++ b/src/eval.c
@@ -12647,14 +12647,13 @@ f_has(argvars, rettv)
 	    {
 		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()))));
+				 && has_patch(atoi((char *)name + 10))))));
 	    }
 	    else
 		n = has_patch(atoi((char *)name + 5));
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    237,
+/**/
     236,
 /**/
     235,