You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228671-pipe-mime.patch 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From: Antonio Radici <antonio@debian.org>
  2. Date: Thu, 27 Feb 2014 17:11:56 +0100
  3. Subject: 228671-pipe-mime
  4. Don't draw imap fetch progress if we aren't in visual mode.
  5. Drawing progress leaves terminal in confusing state when
  6. piping a message from pager to less(1).
  7. See http://bugs.mutt.org/1771
  8. Updated in Debian bug #569279
  9. Gbp-Pq: Topic upstream
  10. ---
  11. imap/message.c | 14 ++++++++++----
  12. 1 file changed, 10 insertions(+), 4 deletions(-)
  13. diff --git a/imap/message.c b/imap/message.c
  14. index 3c9822f..3504be8 100644
  15. --- a/imap/message.c
  16. +++ b/imap/message.c
  17. @@ -398,7 +398,7 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno)
  18. char path[_POSIX_PATH_MAX];
  19. char *pc;
  20. long bytes;
  21. - progress_t progressbar;
  22. + progress_t progressbar, *pbar;
  23. int uid;
  24. int cacheno;
  25. IMAP_CACHE *cache;
  26. @@ -495,9 +495,15 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno)
  27. imap_error ("imap_fetch_message()", buf);
  28. goto bail;
  29. }
  30. - mutt_progress_init (&progressbar, _("Fetching message..."),
  31. - M_PROGRESS_SIZE, NetInc, bytes);
  32. - if (imap_read_literal (msg->fp, idata, bytes, &progressbar) < 0)
  33. + if (!isendwin())
  34. + {
  35. + mutt_progress_init (&progressbar, _("Fetching message..."),
  36. + M_PROGRESS_SIZE, NetInc, bytes);
  37. + pbar = &progressbar;
  38. + }
  39. + else
  40. + pbar = NULL;
  41. + if (imap_read_literal (msg->fp, idata, bytes, pbar) < 0)
  42. goto bail;
  43. /* pick up trailing line */
  44. if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE)