Martin Toft wrote:

> On Sun, Aug 19, 2007 at 05:52:56PM +0200, Bram Moolenaar wrote:
> > My proposal is that you fix it :-)  We have mch_has_wildcard(), but it
> > applies to a whole string, so you need to do some more work.
> 
> Okidoki :-)
> 
> I'm sorry to be slow, but my parents suddenly decided to pay me a visit,
> and you don't say no to a free meal :-)  (they brought it with them...)

And now the software is starving... :-).

> Here is a patch for the problem.  Everybody on the list is very welcome
> to test it and comment on it!
> 
> I had to cheat a bit with regard to ']', as we want to be able to
> ':e [a-z]<Tab>' etc., and mch_has_wildcard("]") returns false.
> 
> Thanks to Yegappan Lakshmanan for reporting the bug.

Good catch with "]".  By itself it's not recognized, only the matching
"[" is.

How about making a bit cleaner:  You are overwriting the string and
restoring the character in four places.  If we make a
vim_isfilec_or_wc() function that could be simplified a lot.  You can
safely assume that a wildcard char is not multi-byte.  Thus putting the
byte in a two-byte buffer and then invoking mch_has_wildcard() should be
OK.

-- 
hundred-and-one symptoms of being an internet addict:
204. You're being audited because you mailed your tax return to the IRC.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui