MCPcopy Index your code
hub / github.com/git/git / match_next_pattern

Function match_next_pattern

grep.c:1151–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1149}
1150
1151static int match_next_pattern(struct grep_pat *p,
1152 const char *bol, const char *eol,
1153 enum grep_context ctx,
1154 regmatch_t *pmatch, int eflags)
1155{
1156 regmatch_t match;
1157
1158 if (!headerless_match_one_pattern(p, bol, eol, ctx, &match, eflags))
1159 return 0;
1160 if (match.rm_so < 0 || match.rm_eo < 0)
1161 return 0;
1162 if (pmatch->rm_so >= 0 && pmatch->rm_eo >= 0) {
1163 if (match.rm_so > pmatch->rm_so)
1164 return 1;
1165 if (match.rm_so == pmatch->rm_so && match.rm_eo < pmatch->rm_eo)
1166 return 1;
1167 }
1168 pmatch->rm_so = match.rm_so;
1169 pmatch->rm_eo = match.rm_eo;
1170 return 1;
1171}
1172
1173int grep_next_match(struct grep_opt *opt,
1174 const char *bol, const char *eol,

Callers 1

grep_next_matchFunction · 0.85

Calls 1

Tested by

no test coverage detected