Lines Matching refs:pat
35 static int do_glob(char *buf, size_t pos, int type, char *pat, int flags, int (*errfunc)(const char… in do_glob() argument
42 if (*pat && type!=DT_DIR) type = 0; in do_glob()
43 while (pos+1 < PATH_MAX && *pat=='/') buf[pos++] = *pat++; in do_glob()
49 for (; pat[i]!='*' && pat[i]!='?' && (!in_bracket || pat[i]!=']'); i++) { in do_glob()
50 if (!pat[i]) { in do_glob()
52 pat += i; in do_glob()
56 } else if (pat[i] == '[') { in do_glob()
58 } else if (pat[i] == '\\' && !(flags & GLOB_NOESCAPE)) { in do_glob()
62 if (in_bracket && pat[i+1]==']') break; in do_glob()
64 if (!pat[i+1]) return 0; in do_glob()
67 if (pat[i] == '/') { in do_glob()
70 pat += i+1; in do_glob()
81 buf[pos+j++] = pat[i]; in do_glob()
92 if (!*pat) { in do_glob()
116 char *p2 = strchr(pat, '/'), saved_sep = '/'; in do_glob()
121 for (p=p2; p>pat && p[-1]=='\\'; p--); in do_glob()
148 if (fnmatch(pat, de->d_name, fnm_flags)) in do_glob()
155 && fnmatch(pat, de->d_name, fnm_flags | FNM_PERIOD)) in do_glob()
194 static int expand_tilde(char **pat, char *buf, size_t *pos) in expand_tilde() argument
196 char *p = *pat + 1; in expand_tilde()
201 *pat = name_end; in expand_tilde()
227 int glob(const char *restrict pat, int flags, int (*errfunc)(const char *path, int err), glob_t *re… in glob() argument
243 if (*pat) { in glob()
244 char *p = strdup(pat); in glob()
265 if (append(&tail, pat, strlen(pat), 0)) in glob()