X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=pager.c;h=0e975e430466f3c54b7f1bc91fb62cfd41289fc9;hb=16ff93bd19515d67ea15468b4adb35395970a559;hp=095aa698f6e97124632309aadf0a3f4cee3600ea;hpb=7a65e5ebdec7a76fb26412022bd1e5ef739e53f2;p=apps%2Fmadmutt.git diff --git a/pager.c b/pager.c index 095aa69..0e975e4 100644 --- a/pager.c +++ b/pager.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mutt_curses.h" #include "mutt_regex.h" @@ -971,7 +975,7 @@ fill_buffer (FILE *f, long *last_pos, long offset, unsigned char *buf, unsigned char *fmt, size_t blen, int *buf_ready) { unsigned char *p; - static int b_read; + static int b_read = 0; if (*buf_ready == 0) { @@ -1735,17 +1739,17 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) CLEARLINE_WIN(statusoffset); if (IsHeader (extra)) { - _mutt_make_string (buffer, - COLS-9-SidebarWidth < sizeof (buffer) ? - COLS-9-SidebarWidth : sizeof (buffer), - NONULL (PagerFmt), Context, extra->hdr, M_FORMAT_MAKEPRINT); + size_t l1 = (COLS - 9) * MB_LEN_MAX; + size_t l2 = sizeof (buffer); + _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), + Context, extra->hdr, M_FORMAT_MAKEPRINT); } else if (IsMsgAttach (extra)) { - _mutt_make_string (buffer, - COLS - 9 - SidebarWidth < sizeof (buffer) ? - COLS - 9 - SidebarWidth : sizeof (buffer), - NONULL (PagerFmt), Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT); + size_t l1 = (COLS - 9) * MB_LEN_MAX; + size_t l2 = sizeof (buffer); + _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), + Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT); } mutt_paddstr (COLS-10-SidebarWidth, IsHeader (extra) || IsMsgAttach (extra) ? buffer : banner); @@ -2218,6 +2222,17 @@ search_next: mutt_resend_message (NULL, extra->ctx, extra->hdr); redraw = REDRAW_FULL; break; + + case OP_CHECK_TRADITIONAL: + CHECK_MODE (IsHeader (extra)); + if (!(WithCrypto & APPLICATION_PGP)) + break; + if (!(extra->hdr->security & PGP_TRADITIONAL_CHECKED)) + { + ch = -1; + rc = OP_CHECK_TRADITIONAL; + } + break; case OP_CREATE_ALIAS: CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra)); @@ -2430,7 +2445,7 @@ CHECK_IMAP_ACL(IMAP_ACL_WRITE); case OP_MAIL: CHECK_MODE(IsHeader (extra) && !IsAttach (extra)); CHECK_ATTACH; - ci_send_message (0, NULL, NULL, extra->ctx, extra->hdr); + ci_send_message (0, NULL, NULL, extra->ctx, NULL); redraw = REDRAW_FULL; break; @@ -2501,7 +2516,7 @@ CHECK_IMAP_ACL(IMAP_ACL_WRITE); break; case OP_RECALL_MESSAGE: - CHECK_MODE(IsHeader (extra)); + CHECK_MODE(IsHeader (extra) && !IsAttach(extra)); CHECK_ATTACH; ci_send_message (SENDPOSTPONED, NULL, NULL, extra->ctx, extra->hdr); redraw = REDRAW_FULL;