diff options
author | Brandon Casey <drafnel@gmail.com> | 2009-08-04 22:31:57 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-05 12:13:57 -0700 |
commit | c8f373a5ce8be2b85da25f1e3b1ef9056ecca4a6 (patch) | |
tree | 6c3a5e6895c633da8f4be875a785d64524cf04d5 /builtin-mailinfo.c | |
parent | c7e4f0d78aaac33d5e3cec54cddd40439e77d16c (diff) | |
download | git-c8f373a5ce8be2b85da25f1e3b1ef9056ecca4a6.tar.gz |
builtin-mailinfo,builtin-mailsplit: use strbufs
There should be no functional change. Just the necessary changes and
simplifications associated with calling strbuf_getwholeline() rather
than an internal function or fgets.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-mailinfo.c')
-rw-r--r-- | builtin-mailinfo.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c index 92637ac0ba..b0b5d8f6cb 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); |