Lines Matching refs:pattern
47 * Set in gl_flags if pattern contained a globbing character.
49 * Same as GLOB_NOCHECK, but it will only append pattern if it did
167 glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
175 patnext = (u_char *) pattern;
218 * Expand recursively a glob {} pattern. When there is no more expansion
223 globexp1(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
225 const Char* ptr = pattern;
228 if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
229 return glob0(pattern, pglob, limitp);
232 return globexp2(ptr, pattern, pglob, limitp);
234 return glob0(pattern, pglob, limitp);
240 * If it succeeds then it invokes globexp1 with the new pattern.
241 * If it fails then it tries to glob the rest of the pattern and returns.
244 globexp2(const Char *ptr, const Char *pattern, glob_t *pglob,
253 for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
279 /* Non matching braces; just glob the pattern */
317 * Append the rest of the pattern after the
323 /* Expand the current pattern */
349 globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
356 if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
357 return pattern;
361 for (p = pattern + 1, h = (char *) patbuf;
382 return pattern;
391 return pattern;
400 /* Append the rest of the pattern */
426 const Char *pattern = *patternp + 1;
432 if ((colon = g_strchr(pattern, ':')) == NULL || colon[1] != ']')
435 len = (size_t)(colon - pattern);
437 if (!g_strncmp(pattern, cc->name, len) && cc->name[len] == '\0')
451 * The main glob() routine: compiles the pattern (optionally processing
452 * quotes), calls glob1() to do the real pattern matching, and finally
458 glob0(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
464 qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
538 * If there was no match we are going to append the pattern
540 * and the pattern did not contain any magic characters
547 return(globextend(pattern, pglob, limitp, NULL));
564 glob1(Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
569 if (*pattern == EOS)
573 pattern, pattern_last, pglob, limitp));
578 * of recursion for each segment in the pattern that contains one or more
583 Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
590 * Loop over pattern segments until end of pattern or until
594 if (*pattern == EOS) { /* End of pattern? */
623 p = pattern;
634 pattern = p;
635 while (*pattern == SEP) {
638 *pathend++ = *pattern++;
643 pathend_last, pattern, p, pattern_last,
651 Char *pattern, Char *restpattern, Char *restpattern_last, glob_t *pglob,
704 if (dp->d_name[0] == DOT && *pattern != DOT)
716 if (!match(pathend, pattern, restpattern)) {
849 * pattern matching function for filenames. Each occurrence of the *
850 * pattern causes a recursion level.