Lines Matching refs:pattern
40 * Compares a filename or pathname to a pattern.
56 fnmatch(const char *pattern, const char *string, int flags)
63 switch (c = *pattern++) {
80 c = *pattern;
83 c = *++pattern;
90 /* Optimize for pattern with * at end or before /. */
106 if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
123 switch (rangematch(pattern, *string, flags, &newp)) {
127 pattern = newp;
136 if ((c = *pattern++) == EOS) {
138 --pattern;
159 rangematch(const char *pattern, char test, int flags, char **newp)
171 if ( (negate = (*pattern == '!' || *pattern == '^')) )
172 ++pattern;
183 c = *pattern++;
186 c = *pattern++;
196 if (*pattern == '-'
197 && (c2 = *(pattern+1)) != EOS && c2 != ']') {
198 pattern += 2;
200 c2 = *pattern++;
211 } while ((c = *pattern++) != ']');
213 *newp = (char *)(uintptr_t)pattern;