| 24 | }; |
| 25 | |
| 26 | static int diffgrep_consume(void *priv, char *line, unsigned long len) |
| 27 | { |
| 28 | struct diffgrep_cb *data = priv; |
| 29 | regmatch_t regmatch; |
| 30 | |
| 31 | if (line[0] != '+' && line[0] != '-') |
| 32 | return 0; |
| 33 | if (data->hit) |
| 34 | BUG("Already matched in diffgrep_consume! Broken xdiff_emit_line_fn?"); |
| 35 | if (!regexec_buf(data->regexp, line + 1, len - 1, 1, |
| 36 | ®match, 0)) { |
| 37 | data->hit = 1; |
| 38 | return 1; |
| 39 | } |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | static int diff_grep(mmfile_t *one, mmfile_t *two, |
| 44 | struct diff_options *o, |
nothing calls this directly
no test coverage detected