[patch] has('patch-7.4.1') doesn't work well

2016-03-26 Thread thinca
Hi

I found a bug around has-patch

echo has('patch-7.4.001')
" => 1
echo has('patch-7.4.01')
" => 1
echo has('patch-7.4.1')
" => 0

I wrote a patch.  Please check.

diff --git a/src/eval.c b/src/eval.c
index 06f3585..b229aef 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -13837,7 +13837,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]))


--
thinca 

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [patch] has('patch-7.4.1') doesn't work well

2016-03-26 Thread Bram Moolenaar

Thinca wrote:

> I found a bug around has-patch
> 
> echo has('patch-7.4.001')
> " => 1
> echo has('patch-7.4.01')
> " => 1
> echo has('patch-7.4.1')
> " => 0
> 
> I wrote a patch.  Please check.
> 
> diff --git a/src/eval.c b/src/eval.c
> index 06f3585..b229aef 100644
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -13837,7 +13837,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]))
> 

Thanks!

-- 
Never eat yellow snow.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.