Lines Matching defs:pat
538 static char *last_search_pat; /* last !?pat[?] search pattern */
539 static char *last_search_match; /* last !?pat[?] that matched */
546 char *pat;
604 pat = last_search_pat;
608 if ((pat = el_calloc(len + 1, sizeof(*pat))) == NULL)
610 (void)strlcpy(pat, cmd + begin, len + 1);
614 if (pat != last_search_pat)
615 el_free(pat);
621 if (pat != last_search_pat) {
624 last_search_pat = pat;
626 ret = history_search(pat, -1);
628 ret = history_search_prefix(pat, -1);
633 (void)fprintf(rl_outstream, "%s: Event not found\n", pat);
634 if (pat != last_search_pat)
635 el_free(pat);
640 if (last_search_match && last_search_match != pat)
642 last_search_match = pat;
645 if (pat != last_search_pat)
646 el_free(pat);
731 if (*cmd == '%') /* last word matched by ?pat? */