Lines Matching defs:str
29 static int str_next(const char *str, size_t n, size_t *step)
35 if (str[0] >= 128U) {
37 int k = mbtowc(&wc, str, n);
46 return str[0];
163 static int fnmatch_internal(const char *pat, size_t m, const char *str, size_t n, int flags)
171 if (*str == '.' && *pat != '.')
183 k = str_next(str, n, &sinc);
186 str += sinc;
224 /* Compute real str length if it was initially unknown/-1 */
225 n = strnlen(str, n);
226 endstr = str + n;
229 /* Find the final tailcnt chars of str, accounting for UTF-8.
232 for (s=endstr; s>str && tailcnt; tailcnt--) {
234 else while ((unsigned char)*--s-0x80U<0x40 && s>str);
239 /* Check that the pat and str tails match */
265 s = str;
272 str = s;
288 /* If we failed, advance str, by 1 char if it's a valid
290 k = str_next(str, endstr-str, &sinc);
291 if (k > 0) str += sinc;
292 else for (str++; str_next(str, endstr-str, &sinc)<0; str++);
298 int fnmatch(const char *pat, const char *str, int flags)
304 for (s=str; *s && *s!='/'; s++);
308 if (fnmatch_internal(pat, p-pat, str, s-str, flags))
311 str = s+1;
314 for (s=str; *s; s++) {
316 if (!fnmatch_internal(pat, -1, str, s-str, flags))
320 return fnmatch_internal(pat, -1, str, -1, flags);