X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-mailinfo.c;h=b0b5d8f6cb5107f3422d6107fd56f35ef62786f6;hb=232d4537667e32230c855777444abbe732536ed9;hp=92637ac0bae82d0b88e267b572a51a75299cda5c;hpb=5dc36a5888a7063ff4536c9ea50eb0557bfef627;p=git.git diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 92637ac0b..b0b5d8f6c 100644 --- a/builtin-mailinfo.c +++ b/builtin-mailinfo.c @@ -765,7 +765,6 @@ static void handle_filter(struct strbuf *line) static void handle_body(void) { - int len = 0; struct strbuf prev = STRBUF_INIT; /* Skip up to the first boundary */ @@ -775,8 +774,6 @@ static void handle_body(void) } do { - strbuf_setlen(&line, line.len + len); - /* process any boundary lines */ if (*content_top && is_multipart_boundary(&line)) { /* flush any leftover */ @@ -832,10 +829,7 @@ static void handle_body(void) handle_filter(&line); } - strbuf_reset(&line); - if (strbuf_avail(&line) < 100) - strbuf_grow(&line, 100); - } while ((len = read_line_with_nul(line.buf, strbuf_avail(&line), fin))); + } while (!strbuf_getwholeline(&line, fin, '\n')); handle_body_out: strbuf_release(&prev);