X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=handler.c;h=e7ca176535e862b3782382d3bcf68753fd48454b;hp=4129fda38e6231eb9208430e3e4d20fa66abc339;hb=1a6071baa1d376cd45ab88891b00181bb84042f1;hpb=23e6291cb5d5b4cd2008403d8b628007fd75ff23 diff --git a/handler.c b/handler.c index 4129fda..e7ca176 100644 --- a/handler.c +++ b/handler.c @@ -25,14 +25,13 @@ #include #include +#include #include #include "mutt.h" #include "recvattach.h" #include "handler.h" -#include "rfc1524.h" -#include "rfc3676.h" #include "keymap.h" #include "copy.h" #include "charset.h" @@ -271,7 +270,7 @@ void mutt_decode_base64 (STATE * s, long len, int istext, iconv_t cd) else bufi[l++] = ch; - if (l + 8 >= sizeof (bufi)) + if (l + 8 >= ssizeof (bufi)) mutt_convert_to_state (cd, bufi, &l, s); } @@ -840,12 +839,12 @@ static int alternative_handler (BODY * a, STATE * s) while (b) { snprintf (buf, sizeof (buf), "%s/%s", TYPE (b), b->subtype); if (mutt_is_autoview (b, buf)) { - rfc1524_entry *entry = rfc1524_new_entry (); + rfc1524_entry *entry = rfc1524_entry_new(); if (rfc1524_mailcap_lookup (b, buf, entry, M_AUTOVIEW)) { choice = b; } - rfc1524_free_entry (&entry); + rfc1524_entry_delete(&entry); } b = b->next; } @@ -1057,7 +1056,7 @@ static int multipart_handler (BODY * a, STATE * s) static int autoview_handler (BODY * a, STATE * s) { - rfc1524_entry *entry = rfc1524_new_entry (); + rfc1524_entry *entry = rfc1524_entry_new(); char buffer[LONG_STRING]; char type[STRING]; char command[LONG_STRING]; @@ -1094,7 +1093,7 @@ static int autoview_handler (BODY * a, STATE * s) if ((fpin = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror ("fopen"); - rfc1524_free_entry (&entry); + rfc1524_entry_delete(&entry); return (-1); } @@ -1170,7 +1169,7 @@ static int autoview_handler (BODY * a, STATE * s) if (s->flags & M_DISPLAY) mutt_clear_error (); } - rfc1524_free_entry (&entry); + rfc1524_entry_delete(&entry); return (rc); } @@ -1260,7 +1259,7 @@ static int external_body_handler (BODY * b, STATE * s) void mutt_decode_attachment (BODY * b, STATE * s) { int istext = mutt_is_text_part (b); - iconv_t cd = (iconv_t) (-1); + iconv_t cd = MUTT_ICONV_ERROR; Quotebuf[0] = '\0'; @@ -1269,7 +1268,7 @@ void mutt_decode_attachment (BODY * b, STATE * s) const char *charset = mutt_get_parameter ("charset", b->parameter); if (!option (OPTSTRICTMIME) && !charset) - charset = mutt_get_first_charset (AssumedCharset); + charset = charset_getfirst(AssumedCharset); if (charset && Charset) cd = mutt_iconv_open (Charset, charset, M_ICONV_HOOK_FROM); } @@ -1299,7 +1298,7 @@ void mutt_decode_attachment (BODY * b, STATE * s) break; } - if (cd != (iconv_t) (-1)) + if (cd != MUTT_ICONV_ERROR) iconv_close (cd); } @@ -1321,13 +1320,13 @@ int mutt_body_handler (BODY * b, STATE * s) snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype); if (mutt_is_autoview (b, type)) { - rfc1524_entry *entry = rfc1524_new_entry (); + rfc1524_entry *entry = rfc1524_entry_new(); if (rfc1524_mailcap_lookup (b, type, entry, M_AUTOVIEW)) { handler = autoview_handler; s->flags &= ~M_CHARCONV; } - rfc1524_free_entry (&entry); + rfc1524_entry_delete(&entry); } else if (b->type == TYPETEXT) { if (ascii_strcasecmp ("plain", b->subtype) == 0) {