Lines Matching refs:pattern
45 * Compares a filename or pathname to a pattern.
62 rk_fnmatch(const char *pattern, const char *string, int flags)
68 switch (c = *pattern++) {
83 c = *pattern;
86 c = *++pattern;
93 /* Optimize for pattern with * at end or before /. */
108 if (!rk_fnmatch(pattern, string, flags & ~FNM_PERIOD))
120 if ((pattern =
121 rangematch(pattern, *string, flags)) == NULL)
127 if ((c = *pattern++) == EOS) {
129 --pattern;
142 rangematch(const char *pattern, int test, int flags)
154 if (negate = (*pattern == '!' || *pattern == '^'))
155 ++pattern;
157 for (ok = 0; (c = *pattern++) != ']';) {
159 c = *pattern++;
162 if (*pattern == '-'
163 && (c2 = *(pattern+1)) != EOS && c2 != ']') {
164 pattern += 2;
166 c2 = *pattern++;
174 return (ok == negate ? NULL : pattern);