ZyX wrote:

> > --- 12638,12664 ----
> >       if (n == FALSE)
> >       {
> >     if (STRNICMP(name, "patch", 5) == 0)
> > !   {
> > !       if (name[5] == '-'
> > !               && STRLEN(name) > 11
> > !               && vim_isdigit(name[6])
> > !               && vim_isdigit(name[8])
> > !               && vim_isdigit(name[10]))
> > !       {
> > !           int major = atoi((char *)name + 6);
> > !           int minor = atoi((char *)name + 8);
> > !           int patch = atoi((char *)name + 10);
> > ! 
> > !           /* Expect "patch-9.9.01234". */
> > !           n = (major < VIM_VERSION_MAJOR
> > !                || (major == VIM_VERSION_MAJOR
> > !                    && (minor < VIM_VERSION_MINOR
> > !                        || (minor == VIM_VERSION_MINOR
> > !                            && patch <= highest_patch()))));
> 
> If I am not mistaking, this (using highest_patch()) means not that
> patch was actually included, but that last included patch number is
> greater then or equal to requested one. This is a useless check:
> checking against the patch number usually means missing ability to use
> has()/exists() to check for feature existence, so on some
> distributions (e.g. CentOS) that like to include only a subset of
> patches (i.e. only patches that fix bugs) using (has('patch-7.4.100'))
> will falsely report 1 while actually patch 100 is missing (though 101
> was included), but `has('patch100')` will report that it is missing.
> 
> I think here `has_patch()` should be used, not highest_patch().

In practice it should not matter, I can't think of a reason why someone
would skip some patches.  Well, perhaps if someone really only gets a
specific patch to fix a problem that was noticed.

The reason I used highest_patch() is that I first wrote the
documentation that it behaves that way.  But I see your point, in case
someone cherry picks patches and a plugin really needs a specific patch,
using has_patch() is better.

-- 
hundred-and-one symptoms of being an internet addict:
21. Your dog has its own home page.

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui