diff options
author | Rocco Rutte <pdmef@gmx.net> | 2009-06-21 21:32:34 +0200 |
---|---|---|
committer | Rocco Rutte <pdmef@gmx.net> | 2009-06-21 21:32:34 +0200 |
commit | 8e7eaed5716babc4b0af3daac7b9a4fd033c1013 (patch) | |
tree | b281aa4fc44c02c85d2219e229811b2cb49e3539 /handler.c | |
parent | 8909323ad439d6843eb74a4025d840a2d90cdc36 (diff) |
Port f=f and text/plain handlers to mutt_read_line()
Diffstat (limited to 'handler.c')
-rw-r--r-- | handler.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1492,16 +1492,14 @@ void mutt_decode_attachment (BODY *b, STATE *s) */ static int text_plain_handler (BODY *b, STATE *s) { - char buf[LONG_STRING]; - size_t l; + char *buf = NULL; + size_t l = 0, sz = 0; - while (fgets (buf, sizeof (buf), s->fpin)) + while ((buf = mutt_read_line (buf, &sz, s->fpin, NULL, 0))) { - l = mutt_strlen (buf); - if (l > 0 && buf[l-1] == '\n') - buf[--l] = 0; if (mutt_strcmp (buf, "-- ") != 0 && option (OPTTEXTFLOWED)) { + l = mutt_strlen (buf); while (l > 0 && buf[l-1] == ' ') buf[--l] = 0; } @@ -1511,6 +1509,7 @@ static int text_plain_handler (BODY *b, STATE *s) state_putc ('\n', s); } + FREE (&buf); return 0; } |