Merge branch 'mp/for-each-ref-missing-name-or-email'

"for-each-ref" and friends that shows refs did not protect themselves
against ancient tags that did not record tagger names when asked to
show "%(taggername)", which have been corrected.

* mp/for-each-ref-missing-name-or-email:
  ref-filter: initialize empty name or email fields
This commit is contained in:
Junio C Hamano
2019-09-09 12:26:39 -07:00
2 changed files with 22 additions and 3 deletions

View File

@ -1028,7 +1028,7 @@ static const char *copy_name(const char *buf)
if (!strncmp(cp, " <", 2))
return xmemdupz(buf, cp - buf);
}
return "";
return xstrdup("");
}
static const char *copy_email(const char *buf)
@ -1036,10 +1036,10 @@ static const char *copy_email(const char *buf)
const char *email = strchr(buf, '<');
const char *eoemail;
if (!email)
return "";
return xstrdup("");
eoemail = strchr(email, '>');
if (!eoemail)
return "";
return xstrdup("");
return xmemdupz(email, eoemail + 1 - email);
}