1 diff -udprP mutt-1.5.21.orig/handler.c mutt-1.5.21/handler.c
2 --- mutt-1.5.21.orig/handler.c 2009-08-25 22:08:52.000000000 +0300
3 +++ mutt-1.5.21/handler.c 2010-09-16 11:06:34.000000000 +0300
4 @@ -1504,7 +1504,31 @@ static int text_plain_handler (BODY *b,
8 - state_puts (s->prefix, s);
11 + char qbuf[2 * LONG_STRING];
12 + int j = 0, offset = 0;
13 + regmatch_t pmatch[1];
15 + while (regexec ((regex_t *) QuoteRegexp.rx, &buf[offset], 1, pmatch, 0) == 0)
16 + offset += pmatch->rm_eo;
18 + if (!option (OPTQUOTEEMPTY) && !*buf)
20 + else if (option (OPTQUOTEQUOTED) && offset)
22 + for (i = 0; i < offset; i++)
25 + strncpy (qbuf, buf, j + 1);
26 + strcpy (qbuf + j + 1, buf + j);
29 + snprintf (qbuf, sizeof (qbuf), "%s%s", NONULL(s->prefix), buf);
31 + state_puts (qbuf, s);
37 @@ -1550,7 +1574,7 @@ int mutt_body_handler (BODY *b, STATE *s
39 if ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp (b))
40 handler = crypt_pgp_application_pgp_handler;
41 - else if (ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0)
42 + else if (ascii_strcasecmp ("flowed", mutt_get_parameter ("format", b->parameter)) == 0 && !s->prefix)
43 handler = rfc3676_handler;
45 handler = text_plain_handler;
46 diff -udprP mutt-1.5.21.orig/init.h mutt-1.5.21/init.h
47 --- mutt-1.5.21.orig/init.h 2010-09-15 18:39:31.000000000 +0300
48 +++ mutt-1.5.21/init.h 2010-09-16 11:06:34.000000000 +0300
49 @@ -2214,6 +2214,19 @@ struct option_t MuttVars[] = {
50 ** have no effect, and if it is set to \fIask-yes\fP or \fIask-no\fP, you are
51 ** prompted for confirmation when you try to quit.
53 + { "quote_empty", DT_BOOL, R_NONE, OPTQUOTEEMPTY, 1 },
56 + ** Controls whether or not empty lines will be quoted using
57 + ** ``$indent_string''.
59 + { "quote_quoted", DT_BOOL, R_NONE, OPTQUOTEQUOTED, 0 },
62 + ** Controls how quoted lines will be quoted. If set, one quote
63 + ** character will be added to the end of existing prefix. Otherwise,
64 + ** quoted lines will be prepended by ``$indent_string''.
66 { "quote_regexp", DT_RX, R_PAGER, UL &QuoteRegexp, UL "^([ \t]*[|>:}#])+" },
69 diff -udprP mutt-1.5.21.orig/mutt.h mutt-1.5.21/mutt.h
70 --- mutt-1.5.21.orig/mutt.h 2010-09-13 20:19:55.000000000 +0300
71 +++ mutt-1.5.21/mutt.h 2010-09-16 11:06:34.000000000 +0300
72 @@ -408,6 +408,8 @@ enum
81 diff -udprP mutt-1.5.21.orig/PATCHES mutt-1.5.21/PATCHES
82 --- mutt-1.5.21.orig/PATCHES 2008-03-19 22:07:06.000000000 +0200
83 +++ mutt-1.5.21/PATCHES 2010-09-16 11:06:34.000000000 +0300