Lines Matching defs:pattern
41 * Compares a filename or pathname to a pattern.
77 fnmatch(pattern, string, flags)
78 const char *pattern, *string;
84 return (fnmatch1(pattern, string, string, flags, initial, initial,
89 fnmatch1(const char *pattern, const char *string, const char *stringstart,
98 pclen = mbrtowc_l(&pc, pattern, MB_LEN_MAX, &patmbs, loc);
101 pattern += pclen;
127 c = *pattern;
130 c = *++pattern;
137 /* Optimize for pattern with * at end or before /. */
152 if (!fnmatch1(pattern, string, stringstart,
179 switch (rangematch(pattern, sc, flags, &newp,
184 pattern = newp;
193 pclen = mbrtowc_l(&pc, pattern, MB_LEN_MAX,
199 pattern += pclen;
220 rangematch(const char *pattern, wchar_t test, int flags, char **newp,
235 if ((negate = (*pattern == '!' || *pattern == '^')) != 0)
236 ++pattern;
247 origpat = pattern;
249 if (*pattern == ']' && pattern > origpat) {
250 pattern++;
252 } else if (*pattern == '\0') {
254 } else if (*pattern == '/' && (flags & FNM_PATHNAME)) {
256 } else if (*pattern == '\\' && !(flags & FNM_NOESCAPE))
257 pattern++;
258 pclen = mbrtowc_l(&c, pattern, MB_LEN_MAX, patmbs, loc);
261 pattern += pclen;
266 if (*pattern == '-' && *(pattern + 1) != EOS &&
267 *(pattern + 1) != ']') {
268 if (*++pattern == '\\' && !(flags & FNM_NOESCAPE))
269 if (*pattern != EOS)
270 pattern++;
271 pclen = mbrtowc_l(&c2, pattern, MB_LEN_MAX, patmbs,
275 pattern += pclen;
291 *newp = (char *)pattern;