Patch 9.0.0010
Problem:    Returning 0 for has('patch-9.0.0') is inconsistent.
Solution:   Make it return 1. (closes #10640)
Files:      src/version.c, src/testdir/test_functions.vim


*** ../vim-9.0.0009/src/version.c       2022-06-29 21:16:53.641158372 +0100
--- src/version.c       2022-06-30 10:59:46.304839619 +0100
***************
*** 789,799 ****
      // Perform a binary search.
      l = 0;
      h = (int)ARRAY_LENGTH(included_patches) - 1;
!     while (l < h)
      {
        m = (l + h) / 2;
        if (included_patches[m] == n)
            return TRUE;
        if (included_patches[m] < n)
            h = m;
        else
--- 791,803 ----
      // Perform a binary search.
      l = 0;
      h = (int)ARRAY_LENGTH(included_patches) - 1;
!     for (;;)
      {
        m = (l + h) / 2;
        if (included_patches[m] == n)
            return TRUE;
+       if (l == h)
+           break;
        if (included_patches[m] < n)
            h = m;
        else
*** ../vim-9.0.0009/src/testdir/test_functions.vim      2022-06-05 
18:55:39.000000000 +0100
--- src/testdir/test_functions.vim      2022-06-30 10:52:13.525272644 +0100
***************
*** 40,45 ****
--- 40,48 ----
    " Will we ever have patch 9999?
    let ver = 'patch-' .. v:version / 100 .. '.' .. v:version % 100 .. '.9999'
    call assert_equal(0, has(ver))
+ 
+   " There actually isn't a patch 9.0.0, but this is more consistent.
+   call assert_equal(1, has('patch-9.0.0'))
  endfunc
  
  func Test_empty()
*** ../vim-9.0.0009/src/version.c       2022-06-29 21:16:53.641158372 +0100
--- src/version.c       2022-06-30 10:59:46.304839619 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     10,
  /**/

-- 
Now it is such a bizarrely improbable coincidence that anything as
mind-bogglingly useful as the Babel fish could have evolved purely by chance
that some thinkers have chosen to see it as a final and clinching proof of the
NON-existence of God.
The argument goes something like this: 'I refuse to prove that I exist,' says
God, 'for proof denies faith, and without faith I am nothing.'
'But,' says Man, 'the Babel fish is a dead giveaway, isn't it?  It could not
have evolved by chance.  It proves you exist, and so therefore, by your own
arguments, you don't.  QED.'
'Oh dear,' says God, 'I hadn't thought of that,' and promptly vanishes in a
puff of logic.
'Oh, that was easy,' says Man, and for an encore goes on to prove that black
is white and gets himself killed on the next pedestrian crossing.
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220630100426.2C2151C0390%40moolenaar.net.

Raspunde prin e-mail lui