• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/crypto/openssh/

Lines Matching defs:pattern

644  * Finds the start and end of the first brace pair in the pattern.
648 find_brace(const char *pattern, int *startp, int *endp)
655 for (i = 0; i < INT_MAX && *endp < 0 && pattern[i] != '\0'; i++) {
656 switch (pattern[i]) {
659 if (pattern[i + 1] != '\0')
671 if (pattern[i + 1] == '}') {
699 * Assembles and records a successfully-expanded pattern, returns -1 on
703 emit_expansion(const char *pattern, int brace_start, int brace_end,
707 int o = 0, tail_len = strlen(pattern + brace_end + 1);
715 memcpy(cp, pattern, brace_start);
720 memcpy(cp + o, pattern + sel_start,
724 /* Remainder of pattern after closing brace */
726 memcpy(cp + o, pattern + brace_end + 1, tail_len);
738 * Expand the first encountered brace in pattern, appending the expanded
744 * pattern was invalid via *invalid.
747 brace_expand_one(const char *pattern, char ***patternsp, size_t *npatternsp,
756 if (find_brace(pattern, &brace_start, &brace_end) != 0) {
764 switch (pattern[i]) {
786 if (pattern[i] == ',' || i == brace_end - 1) {
789 /* End of a selection, emit an expanded pattern */
793 if (emit_expansion(pattern, brace_start, brace_end,
810 /* Expand braces from pattern. Returns 0 on success, -1 on failure */
812 brace_expand(const char *pattern, char ***patternsp, size_t *npatternsp)
821 /* Start the worklist with the original pattern */
822 if ((cp = strdup(pattern)) == NULL)
837 fatal("%s: invalid brace pattern \"%s\"", __func__, cp);
841 * active list; discard the progenitor pattern.
1271 fatal("%s: could not expand pattern", __func__);