]> granicus.if.org Git - vim/commitdiff
patch 9.0.0057: has('patch-xxx') returns true v9.0.0057
authorBram Moolenaar <Bram@vim.org>
Mon, 18 Jul 2022 19:48:50 +0000 (20:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 18 Jul 2022 19:48:50 +0000 (20:48 +0100)
Problem:    has('patch-xxx') returns true.
Solution:   Check for digit. (closes #10751)

src/evalfunc.c
src/testdir/test_expr.vim
src/version.c

index f51aade495d017dea9fda54479fa544f925bc9b9..580f5d1bff05becf734682a82dd66dc404e4a90c 100644 (file)
@@ -6473,7 +6473,7 @@ f_has(typval_T *argvars, typval_T *rettv)
                             || (minor == VIM_VERSION_MINOR
                                 && has_patch(atoi((char *)name + 10))))));
            }
-           else
+           else if (isdigit(name[5]))
                n = has_patch(atoi((char *)name + 5));
        }
        else if (STRICMP(name, "vim_starting") == 0)
index ffac6df8064aacd62b798437b1caf21642d62792..f911cd933f1bc48b9dfcd4dab3aad773379c6c30 100644 (file)
@@ -41,6 +41,7 @@ func Test_version()
   call assert_false(has('patch-7.4.'))
   call assert_false(has('patch-9.1.0'))
   call assert_false(has('patch-9.9.1'))
+  call assert_false(has('patch-abc'))
 endfunc
 
 func Test_op_ternary()
index 87a8d10728deeedead6afe36c855a4046a5f567f..ee421e4760ef08e5f11ec11b9f67235dfeef3d42 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    57,
 /**/
     56,
 /**/