aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os_unix.c
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-09-19 19:34:47 -0400
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-31 11:20:23 -0300
commit3f74067565d4661d231679303e9906d3afe2fc3f (patch)
tree1de658da5c4a170f851eae29bdad1f66e1146ab8 /src/nvim/os_unix.c
parent99869989c8be45033f82b567f988a67af6ffda7b (diff)
downloadrneovim-3f74067565d4661d231679303e9906d3afe2fc3f.tar.gz
rneovim-3f74067565d4661d231679303e9906d3afe2fc3f.tar.bz2
rneovim-3f74067565d4661d231679303e9906d3afe2fc3f.zip
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_".
Diffstat (limited to 'src/nvim/os_unix.c')
-rw-r--r--src/nvim/os_unix.c37
1 files changed, 1 insertions, 36 deletions
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index 8e4569033a..82a43499b4 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -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;
}