Lines Matching full:pattern
39 * Compares a filename or pathname to a pattern.
62 static const char *rangematch(const char *pattern, int test, int flags) in rangematch() argument
67 if (pattern == NULL) { in rangematch()
78 negate = *pattern == '!' || *pattern == '^'; in rangematch()
80 ++pattern; in rangematch()
83 for (need = true, ok = false, c = FOLDCASE(*pattern++, flags); c != ']' || need; in rangematch()
84 c = FOLDCASE(*pattern++, flags)) { in rangematch()
91 c = FOLDCASE(*pattern++, flags); in rangematch()
98 if (*pattern == '-') { in rangematch()
99 c2 = FOLDCASE(*(pattern + 1), flags); in rangematch()
101 pattern += 2; in rangematch()
103 c2 = FOLDCASE(*pattern++, flags); in rangematch()
119 return ok == negate ? NULL : pattern; in rangematch()
122 static int fnmatchx(const char *pattern, const char *string, int flags, size_t recursion) in fnmatchx() argument
127 if (pattern == NULL || string == NULL) { in fnmatchx()
136 c = FOLDCASE(*pattern++, flags); in fnmatchx()
162 c = FOLDCASE(*pattern, flags); in fnmatchx()
165 c = FOLDCASE(*++pattern, flags); in fnmatchx()
174 /* Optimize for pattern with * at end or before /. */ in fnmatchx()
200 int e = fnmatchx(pattern, string, flags & ~FNM_PERIOD, recursion); in fnmatchx()
223 r = rangematch(pattern, FOLDCASE(*string, flags), flags); in fnmatchx()
233 pattern = r; in fnmatchx()
240 c = FOLDCASE(*pattern++, flags); in fnmatchx()
243 --pattern; in fnmatchx()
258 int fnmatch(const char *pattern, const char *string, int flags) in fnmatch() argument
260 return fnmatchx(pattern, string, flags, 64); in fnmatch()