MCPcopy Create free account
hub / github.com/git/git / parse_bogus_from

Function parse_bogus_from

mailinfo.c:35–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static void parse_bogus_from(struct mailinfo *mi, const struct strbuf *line)
36{
37 /* John Doe <johndoe> */
38
39 char *bra, *ket;
40 /* This is fallback, so do not bother if we already have an
41 * e-mail address.
42 */
43 if (mi->email.len)
44 return;
45
46 bra = strchr(line->buf, '<');
47 if (!bra)
48 return;
49 ket = strchr(bra, '>');
50 if (!ket)
51 return;
52
53 strbuf_reset(&mi->email);
54 strbuf_add(&mi->email, bra + 1, ket - bra - 1);
55
56 strbuf_reset(&mi->name);
57 strbuf_add(&mi->name, line->buf, bra - line->buf);
58 strbuf_trim(&mi->name);
59 get_sane_name(&mi->name, &mi->name, &mi->email);
60}
61
62static const char *unquote_comment(struct strbuf *outbuf, const char *in)
63{

Callers 1

handle_fromFunction · 0.70

Calls 3

strbuf_addFunction · 0.85
strbuf_trimFunction · 0.85
get_sane_nameFunction · 0.70

Tested by

no test coverage detected