2017-04-28 14:47:43 +00:00
committed by Git OBS Bridge
parent e98f0d53a6
commit 5f1e94b174
19 changed files with 512 additions and 762 deletions

View File

@@ -1,53 +1,52 @@
---
handler.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
handler.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
--- handler.c
+++ handler.c 2016-07-26 12:01:48.801608572 +0000
@@ -780,7 +780,7 @@ static void enriched_set_flags (const wc
static int text_enriched_handler (BODY *a, STATE *s)
{
enum {
- TEXT, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE
+ TEXT, TEXT_GOTWC, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE
} state = TEXT;
long bytes = a->length;
@@ -809,7 +809,7 @@ static int text_enriched_handler (BODY *
+++ handler.c 2017-04-28 13:34:40.080448389 +0000
@@ -816,6 +816,7 @@ static int text_enriched_handler(BODY *a
enum
{
TEXT,
+ TEXT_GOTWC,
LANGLE,
TAG,
BOGUS_TAG,
@@ -853,7 +854,7 @@ static int text_enriched_handler(BODY *a
{
if (state != ST_EOF)
{
- if (!bytes || (wc = fgetwc (s->fpin)) == WEOF)
- if (!bytes || (wc = fgetwc(s->fpin)) == WEOF)
+ if (state != TEXT_GOTWC && (!bytes || (fscanf (s->fpin, "%lc", &wc)) == EOF))
state = ST_EOF;
state = ST_EOF;
else
bytes--;
@@ -817,6 +817,8 @@ static int text_enriched_handler (BODY *
bytes--;
@@ -861,6 +862,8 @@ static int text_enriched_handler(BODY *a
switch (state)
{
+ case TEXT_GOTWC:
+ state = TEXT;
case TEXT :
switch (wc)
{
@@ -877,9 +879,8 @@ static int text_enriched_handler (BODY *
enriched_flush (&stte, 1);
else
{
- ungetwc (wc, s->fpin);
bytes++;
- state = TEXT;
+ state = TEXT_GOTWC;
}
break;
+ state = TEXT;
case TEXT:
switch (wc)
{
@@ -921,9 +924,8 @@ static int text_enriched_handler(BODY *a
enriched_flush(&stte, 1);
else
{
- ungetwc(wc, s->fpin);
bytes++;
- state = TEXT;
+ state = TEXT_GOTWC;
}
break;
@@ -1567,7 +1568,7 @@ void mutt_decode_attachment (BODY *b, ST
@@ -1638,7 +1640,7 @@ void mutt_decode_attachment(BODY *b, STA
* strip all trailing spaces to improve interoperability;
* if $text_flowed is unset, simply verbatim copy input
*/
-static int text_plain_handler (BODY *b, STATE *s)
+static int text_plain_handler (BODY *b __attribute__((unused)), STATE *s)
-static int text_plain_handler(BODY *b, STATE *s)
+static int text_plain_handler(BODY *b __attribute__((unused)), STATE *s)
{
char *buf = NULL;
size_t l = 0, sz = 0;