Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
29333:38a15f3738a2 | 29334:72d1b2ea70dc |
---|---|
733 NULL | 733 NULL |
734 }; | 734 }; |
735 | 735 |
736 static int included_patches[] = | 736 static int included_patches[] = |
737 { /* Add new patch number below this line */ | 737 { /* Add new patch number below this line */ |
738 /**/ | |
739 10, | |
738 /**/ | 740 /**/ |
739 9, | 741 9, |
740 /**/ | 742 /**/ |
741 8, | 743 8, |
742 /**/ | 744 /**/ |
787 int h, m, l; | 789 int h, m, l; |
788 | 790 |
789 // Perform a binary search. | 791 // Perform a binary search. |
790 l = 0; | 792 l = 0; |
791 h = (int)ARRAY_LENGTH(included_patches) - 1; | 793 h = (int)ARRAY_LENGTH(included_patches) - 1; |
792 while (l < h) | 794 for (;;) |
793 { | 795 { |
794 m = (l + h) / 2; | 796 m = (l + h) / 2; |
795 if (included_patches[m] == n) | 797 if (included_patches[m] == n) |
796 return TRUE; | 798 return TRUE; |
799 if (l == h) | |
800 break; | |
797 if (included_patches[m] < n) | 801 if (included_patches[m] < n) |
798 h = m; | 802 h = m; |
799 else | 803 else |
800 l = m + 1; | 804 l = m + 1; |
801 } | 805 } |