Lines Matching refs:pattern

51  *	Set in gl_flags if pattern contained a globbing character.
53 * Same as GLOB_NOCHECK, but it will only append pattern if it did
248 bsd_glob(const char *pattern, int flags,
262 patnext = (U8 *) pattern;
288 * the current directory. To fix this, change the pattern to
292 if (isalpha(pattern[0]) && pattern[1] == ':' &&
293 pattern[2] != BG_SEP && pattern[2] != BG_SEP2 &&
295 *bufnext++ = pattern[0];
306 p = (char *) pattern;
318 /* Transform the pattern:
326 * pattern like '*HD:'; e.g.
333 /* We operate on a copy of the pattern */
334 len = strlen(pattern);
339 p = (char *) pattern;
347 /* The pattern is incorrect: tried to move
401 * Expand recursively a glob {} pattern. When there is no more expansion
406 globexp1(const Char *pattern, glob_t *pglob)
408 const Char* ptr = pattern;
412 if (pattern[0] == BG_LBRACE && pattern[1] == BG_RBRACE && pattern[2] == BG_EOS)
413 return glob0(pattern, pglob);
416 if (!globexp2(ptr, pattern, pglob, &rv))
419 return glob0(pattern, pglob);
425 * If it succeeds then it invokes globexp1 with the new pattern.
426 * If it fails then it tries to glob the rest of the pattern and returns.
429 globexp2(const Char *ptr, const Char *pattern,
438 for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
464 /* Non matching braces; just glob the pattern */
504 * Append the rest of the pattern after the
510 /* Expand the current pattern */
535 globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
541 if (*pattern != BG_TILDE || !(pglob->gl_flags & GLOB_TILDE))
542 return pattern;
546 for (p = pattern + 1, h = (char *) patbuf;
566 return pattern;
570 return pattern;
580 return pattern;
584 return pattern;
592 /* Append the rest of the pattern */
602 * The main glob() routine: compiles the pattern (optionally processing
603 * quotes), calls glob1() to do the real pattern matching, and finally
609 glob0(const Char *pattern, glob_t *pglob)
617 if ( (*pattern == BG_TILDE) && (pglob->gl_flags & GLOB_TILDE) ) {
618 return(globextend(pattern, pglob, &limit));
622 qpat = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
686 * If there was no match we are going to append the pattern
688 * and the pattern did not contain any magic characters
736 glob1(Char *pattern, Char *pattern_last, glob_t *pglob, size_t *limitp)
741 if (*pattern == BG_EOS)
745 pattern, pattern_last, pglob, limitp));
750 * of recursion for each segment in the pattern that contains one or more
755 Char *pattern, Char *pattern_last, glob_t *pglob, size_t *limitp)
762 * Loop over pattern segments until end of pattern or until
766 if (*pattern == BG_EOS) { /* End of pattern? */
801 p = pattern;
816 pattern = p;
817 while (*pattern == BG_SEP
819 || *pattern == BG_SEP2
824 *pathend++ = *pattern++;
829 pathend_last, pattern, pattern_last,
837 Char *pattern, Char *pattern_last,
893 if (*vol_name == BG_DOT && *pattern != BG_DOT)
905 if (!match(pathend, pattern, restpattern, nocase)) {
944 if (dp->d_name[0] == BG_DOT && *pattern != BG_DOT)
956 if (!match(pathend, pattern, restpattern, nocase)) {
1054 * pattern matching function for filenames. Each occurrence of the *
1055 * pattern causes a recursion level.
1219 /* Replace the last occurrence of the pattern ":[^:]+::", e.g. ":lib::",
1220 with a single ':', if possible. It is not an error, if the pattern
1241 /* find a '[^:]::' (e.g. b::) pattern ... */
1277 /* Resolve all updirs in pattern. */
1303 /* if path matches the pattern /:[^:]+:$/, we can