summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-14 21:25:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-14 21:25:31 (GMT)
commit650c90a18506ce05e2be349d83fe1cef3dc7f8cb (patch)
tree6852107d8a2a0d30ea2cfac400fc33bce72fe7bc /dir.c
parent3a66e1bf9c45ac16169c3b6d4a096d5af3ba6929 (diff)
parent2c0a1bd616f6d81905c4e8b98e8c9f2d7324924c (diff)
downloadgit-650c90a18506ce05e2be349d83fe1cef3dc7f8cb.zip
git-650c90a18506ce05e2be349d83fe1cef3dc7f8cb.tar.gz
git-650c90a18506ce05e2be349d83fe1cef3dc7f8cb.tar.bz2
Merge branch 'nd/no-more-fnmatch'
We started using wildmatch() in place of fnmatch(3); complete the process and stop using fnmatch(3). * nd/no-more-fnmatch: actually remove compat fnmatch source code stop using fnmatch (either native or compat) Revert "test-wildmatch: add "perf" command to compare wildmatch and fnmatch" use wildmatch() directly without fnmatch() wrapper
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index 6c6a5d1..70eefdd 100644
--- a/dir.c
+++ b/dir.c
@@ -49,7 +49,9 @@ int strncmp_icase(const char *a, const char *b, size_t count)
int fnmatch_icase(const char *pattern, const char *string, int flags)
{
- return fnmatch(pattern, string, flags | (ignore_case ? FNM_CASEFOLD : 0));
+ return wildmatch(pattern, string,
+ flags | (ignore_case ? WM_CASEFOLD : 0),
+ NULL);
}
inline int git_fnmatch(const struct pathspec_item *item,
@@ -58,7 +60,7 @@ inline int git_fnmatch(const struct pathspec_item *item,
{
if (prefix > 0) {
if (ps_strncmp(item, pattern, string, prefix))
- return FNM_NOMATCH;
+ return WM_NOMATCH;
pattern += prefix;
string += prefix;
}
@@ -76,8 +78,9 @@ inline int git_fnmatch(const struct pathspec_item *item,
NULL);
else
/* wildmatch has not learned no FNM_PATHNAME mode yet */
- return fnmatch(pattern, string,
- item->magic & PATHSPEC_ICASE ? FNM_CASEFOLD : 0);
+ return wildmatch(pattern, string,
+ item->magic & PATHSPEC_ICASE ? WM_CASEFOLD : 0,
+ NULL);
}
static int fnmatch_icase_mem(const char *pattern, int patternlen,