Lines Matching full:pattern

39  * Compares a filename or pathname to a pattern.
63 static const char *rangematch(const char *pattern, int test, int flags) in rangematch() argument
68 if (pattern == NULL) { in rangematch()
79 negate = *pattern == '!' || *pattern == '^'; in rangematch()
81 ++pattern; in rangematch()
84 for (need = true, ok = false, c = FOLDCASE(*pattern++, flags); c != ']' || need; in rangematch()
85 c = FOLDCASE(*pattern++, flags)) { in rangematch()
92 c = FOLDCASE(*pattern++, flags); in rangematch()
99 if (*pattern == '-') { in rangematch()
100 c2 = FOLDCASE(*(pattern + 1), flags); in rangematch()
102 pattern += 2; in rangematch()
104 c2 = FOLDCASE(*pattern++, flags); in rangematch()
120 return ok == negate ? NULL : pattern; in rangematch()
123 static int fnmatchx(const char *pattern, const char *string, int flags, size_t recursion) in fnmatchx() argument
128 if (pattern == NULL || string == NULL) { in fnmatchx()
137 c = FOLDCASE(*pattern++, flags); in fnmatchx()
163 c = FOLDCASE(*pattern, flags); in fnmatchx()
166 c = FOLDCASE(*++pattern, flags); in fnmatchx()
175 /* Optimize for pattern with * at end or before /. */ in fnmatchx()
201 int e = fnmatchx(pattern, string, flags & ~FNM_PERIOD, recursion); in fnmatchx()
224 r = rangematch(pattern, FOLDCASE(*string, flags), flags); in fnmatchx()
234 pattern = r; in fnmatchx()
241 c = FOLDCASE(*pattern++, flags); in fnmatchx()
244 --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()