Lines Matching defs:pattern
38 * Compares a filename or pathname to a pattern.
54 fnmatch(const char *pattern, const char *string, int flags)
61 switch (c = *pattern++) {
78 c = *pattern;
81 c = *++pattern;
88 /* Optimize for pattern with * at end or before /. */
104 if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
121 switch (rangematch(pattern, *string, flags, &newp)) {
125 pattern = newp;
134 if ((c = *pattern++) == EOS) {
136 --pattern;
157 rangematch(const char *pattern, char test, int flags, char **newp)
169 if ( (negate = (*pattern == '!' || *pattern == '^')) )
170 ++pattern;
181 c = *pattern++;
184 c = *pattern++;
194 if (*pattern == '-'
195 && (c2 = *(pattern+1)) != EOS && c2 != ']') {
196 pattern += 2;
198 c2 = *pattern++;
209 } while ((c = *pattern++) != ']');
211 *newp = (char *)(uintptr_t)pattern;