Lines Matching defs:pattern
44 * Compares a filename or pathname to a pattern.
58 fnmatch(const char *pattern, const char *string, int flags)
64 switch (c = *pattern++) {
81 c = *pattern;
84 c = *++pattern;
91 /* Optimize for pattern with * at end or before /. */
107 if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
119 if ((pattern =
120 rangematch(pattern, *string, flags)) == NULL)
126 if ((c = *pattern++) == EOS) {
128 --pattern;
152 rangematch(const char *pattern, char test, int flags)
164 if ( (negate = (*pattern == '!' || *pattern == '^')) )
165 ++pattern;
170 for (ok = 0; (c = *pattern++) != ']';) {
172 c = *pattern++;
179 if (*pattern == '-'
180 && (c2 = *(pattern+1)) != EOS && c2 != ']') {
181 pattern += 2;
183 c2 = *pattern++;
196 return (ok == negate ? NULL : pattern);