Hi Bram and developers,
:echo has('patch-8.1.0')
0
This should return 1.
A patch attached.
NOTE:
This issue was reported by Takuya Fujiwara.
--
Best regards,
Hirohito Higashi (h_east)
--
--
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].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index c14b6e671..9d46e9c2c 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -29,6 +29,8 @@ func Test_version()
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_true(has('patch-7.4.0'))
+ call assert_true(has('patch-8.1.0'))
call assert_false(has('patch-7'))
call assert_false(has('patch-7.4'))
diff --git a/src/version.c b/src/version.c
index ca6ac59f0..c858340c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -1578,9 +1578,11 @@ highest_patch(void)
int
has_patch(int n)
{
- int i;
+ size_t i, size;
- for (i = 0; included_patches[i] != 0; ++i)
+ size = sizeof included_patches / sizeof included_patches[0];
+
+ for (i = 0; i < size; ++i)
if (included_patches[i] == n)
return TRUE;
return FALSE;