On Tue, Sep 21, 2021 at 09:37:23AM +0200, René Scharfe wrote:
quoted
@@ -965,9 +953,12 @@ static int match_one_pattern(struct grep_pat *p, char *bol, char *eol,
bol += len;
switch (p->field) {
case GREP_HEADER_AUTHOR:
- case GREP_HEADER_COMMITTER:
- strip_timestamp(bol, &eol);
+ case GREP_HEADER_COMMITTER: {
+ char *em = memrchr(bol, '>', eol - bol);
+ if (em)
+ eol = em + 1;
The old code documents the intent via the function name. The new one
goes into the nitty-gritty without further explanation, which I find
harder to read.
Agreed. I do think the conversion is functionally correct, but it
doesn't strike me as worth the change.
-Peff