mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 08:48:16 +00:00
Un-mch mch_has_(exp_)wildcard().
Merge mch_has_wildcard() and mch_has_exp_wildcar() with their upstream equivalents for Windows and replace the "mch_" suffix with "path_".
This commit is contained in:

committed by
Thiago de Arruda

parent
99869989c8
commit
3f74067565
@@ -719,47 +719,12 @@ static void save_patterns(int num_pat, char_u **pat, int *num_file,
|
||||
*num_file = num_pat;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the string "p" contains a wildcard that mch_expandpath() can
|
||||
* expand.
|
||||
*/
|
||||
int mch_has_exp_wildcard(char_u *p)
|
||||
{
|
||||
for (; *p; mb_ptr_adv(p)) {
|
||||
if (*p == '\\' && p[1] != NUL)
|
||||
++p;
|
||||
else if (vim_strchr((char_u *)
|
||||
"*?[{'"
|
||||
, *p) != NULL)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if the string "p" contains a wildcard.
|
||||
* Don't recognize '~' at the end as a wildcard.
|
||||
*/
|
||||
int mch_has_wildcard(char_u *p)
|
||||
{
|
||||
for (; *p; mb_ptr_adv(p)) {
|
||||
if (*p == '\\' && p[1] != NUL)
|
||||
++p;
|
||||
else if (vim_strchr((char_u *)
|
||||
"*?[{`'$"
|
||||
, *p) != NULL
|
||||
|| (*p == '~' && p[1] != NUL))
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int have_wildcard(int num, char_u **file)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
if (mch_has_wildcard(file[i]))
|
||||
if (path_has_wildcard(file[i]))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user