]> granicus.if.org Git - vim/commitdiff
patch 7.4.1660 v7.4.1660
authorBram Moolenaar <Bram@vim.org>
Sat, 26 Mar 2016 20:24:14 +0000 (21:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 26 Mar 2016 20:24:14 +0000 (21:24 +0100)
Problem:    has('patch-7.4.1') doesn't work.
Solution:   Fix off-by-one error. (Thinca)

src/eval.c
src/testdir/test60.in
src/testdir/test60.ok
src/testdir/test_expr.vim
src/version.c

index c1046955b7353ff619c36c2bbd44c09dfa4f4db6..49289070d22d86d03e099691d8906303e3e623a2 100644 (file)
@@ -13838,7 +13838,7 @@ f_has(typval_T *argvars, typval_T *rettv)
        if (STRNICMP(name, "patch", 5) == 0)
        {
            if (name[5] == '-'
-                   && STRLEN(name) > 11
+                   && STRLEN(name) >= 11
                    && vim_isdigit(name[6])
                    && vim_isdigit(name[8])
                    && vim_isdigit(name[10]))
index 8835df9e0ca62ccea9a148b2e07c78677cb184b0..d3b299bebaedb7c42d19be50dbc326e41875e5f5 100644 (file)
@@ -589,15 +589,6 @@ endfunction
 endfunction
 :call TestExists()
 :"
-:function TestHas()
-  redir >> test.out
-  for pl in ['6.9.999', '7.1.999', '7.4.123', '9.1.0', '9.9.1']
-    echo 'has patch ' . pl . ': ' . has('patch-' . pl)
-  endfor
-  redir END
-endfunc
-:call TestHas()
-:"
 :delfunc TestExists
 :delfunc RunTest
 :delfunc TestFuncArg
index dabcd0c05da21fe8663610a94c355bbbc2e49007..0c382ad281ec9739694b9d9ddcc6e8f7ffeca988 100644 (file)
@@ -204,8 +204,3 @@ OK
  g:footest#x = 1
    footest#F() 0
 UndefFun() 0
-has patch 6.9.999: 1
-has patch 7.1.999: 1
-has patch 7.4.123: 1
-has patch 9.1.0: 0
-has patch 9.9.1: 0
index 8e55bc53fe593c7673e927681df8ac437ba4e903..f5c9e26c0c216b1f5bea342faf90ffe3e1f4466f 100644 (file)
@@ -21,3 +21,18 @@ func Test_equal()
 
   call assert_fails('echo base.method > instance.method')
 endfunc
+
+func Test_version()
+  call assert_true(has('patch-7.4.001'))
+  call assert_true(has('patch-7.4.01'))
+  call assert_true(has('patch-7.4.1'))
+  call assert_true(has('patch-6.9.999'))
+  call assert_true(has('patch-7.1.999'))
+  call assert_true(has('patch-7.4.123'))
+
+  call assert_false(has('patch-7'))
+  call assert_false(has('patch-7.4'))
+  call assert_false(has('patch-7.4.'))
+  call assert_false(has('patch-9.1.0'))
+  call assert_false(has('patch-9.9.1'))
+endfunc
index dccdb902d1bdcd5e9052339841a563e22e7fe49c..1bd90fa4b1ab0adecf728878832702b90f274947 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1660,
 /**/
     1659,
 /**/