| 906 | } |
| 907 | |
| 908 | static int patmatch(struct grep_pat *p, |
| 909 | const char *line, const char *eol, |
| 910 | regmatch_t *match, int eflags) |
| 911 | { |
| 912 | if (p->pcre2_pattern) |
| 913 | return !pcre2match(p, line, eol, match, eflags); |
| 914 | |
| 915 | switch (regexec_buf(&p->regexp, line, eol - line, 1, match, eflags)) { |
| 916 | case 0: |
| 917 | return 1; |
| 918 | case REG_NOMATCH: |
| 919 | return 0; |
| 920 | default: |
| 921 | return -1; |
| 922 | } |
| 923 | } |
| 924 | |
| 925 | static void strip_timestamp(const char *bol, const char **eol_p) |
| 926 | { |
no test coverage detected