]> git.llucax.com Git - software/mutt-debian.git/blob - debian/patches/upstream/228671-pipe-mime.patch
debian-specific/566076-build_doc_adjustments.patch: use w3m to build the manual ...
[software/mutt-debian.git] / debian / patches / upstream / 228671-pipe-mime.patch
1 Don't draw imap fetch progress if we aren't in visual mode.
2 Drawing progress leaves terminal in confusing state when piping a message
3 from pager to less(1). See http://bugs.mutt.org/1771
4
5 Updated in #569279.
6
7 --- a/imap/message.c
8 +++ b/imap/message.c
9 @@ -398,7 +398,7 @@
10    char path[_POSIX_PATH_MAX];
11    char *pc;
12    long bytes;
13 -  progress_t progressbar;
14 +  progress_t progressbar, *pbar;
15    int uid;
16    int cacheno;
17    IMAP_CACHE *cache;
18 @@ -495,9 +495,15 @@
19             imap_error ("imap_fetch_message()", buf);
20             goto bail;
21           }
22 -         mutt_progress_init (&progressbar, _("Fetching message..."),
23 -                             M_PROGRESS_SIZE, NetInc, bytes);
24 -         if (imap_read_literal (msg->fp, idata, bytes, &progressbar) < 0)
25 +         if (!isendwin())
26 +         {
27 +           mutt_progress_init (&progressbar, _("Fetching message..."),
28 +                             M_PROGRESS_SIZE, NetInc, bytes);
29 +           pbar = &progressbar;
30 +         }
31 +         else
32 +           pbar = NULL;
33 +         if (imap_read_literal (msg->fp, idata, bytes, pbar) < 0)
34             goto bail;
35           /* pick up trailing line */
36           if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE)