diff src/version.c @ 29334:72d1b2ea70dc v9.0.0010

patch 9.0.0010: returning 0 for has('patch-9.0.0') is inconsistent Commit: https://github.com/vim/vim/commit/b0375d466e5ca57dca71995c342870b3226d8115 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 30 11:03:39 2022 +0100 patch 9.0.0010: returning 0 for has('patch-9.0.0') is inconsistent Problem: Returning 0 for has('patch-9.0.0') is inconsistent. Solution: Make it return 1. (closes https://github.com/vim/vim/issues/10640)
author Bram Moolenaar <Bram@vim.org>
date Thu, 30 Jun 2022 12:15:04 +0200
parents a538982f74ea
children 575bc8eaa593
line wrap: on
line diff
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    10,
+/**/
     9,
 /**/
     8,
@@ -789,11 +791,13 @@ has_patch(int n)
     // Perform a binary search.
     l = 0;
     h = (int)ARRAY_LENGTH(included_patches) - 1;
-    while (l < h)
+    for (;;)
     {
 	m = (l + h) / 2;
 	if (included_patches[m] == n)
 	    return TRUE;
+	if (l == h)
+	    break;
 	if (included_patches[m] < n)
 	    h = m;
 	else