X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin-mailinfo.c;h=e890f7a6d1ff7248aed4f03ebbcdfafd7e472dad;hb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;hp=26d3e5d7af1c9d0f4e0e00143ed157f81ee595d0;hpb=c6670b348cb19c74a6d7f6943df4871eb0d8295f;p=git.git diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 26d3e5d7a..e890f7a6d 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -107,7 +107,7 @@ static void handle_from(const struct strbuf *from) el = strcspn(at, " \n\t\r\v\f>"); strbuf_reset(&email); strbuf_add(&email, at, el); - strbuf_remove(&f, at - f.buf, el + 1); + strbuf_remove(&f, at - f.buf, el + (at[el] ? 1 : 0)); /* The remainder is name. It could be "John Doe " * or "john.doe@xz (John Doe)", but we have removed the