Kevin McCarthy [Sun, 22 Sep 2019 01:34:51 +0000 (18:34 -0700)]
Fix mutt_save_message() "enter_fname()" to use buffer version
Commit be632f11 converted this function to use the buffer pool, but
accidentally used the non-buffer prompt when there was already a
buffer-converted version.
Kevin McCarthy [Mon, 2 Sep 2019 02:10:23 +0000 (19:10 -0700)]
Fix memory leak when attaching messages
Setting actx->idx[]->content->parts to NULL causes a memory leak,
because message attachments store a BODY there that needs to be freed.
I looked through the various use cases of ci_send_message() and
actually believe content->parts will be NULL for all other cases
except message attachments. From the comment added to
delete_attachment():
Other ci_send_message() message constructors are careful to free
any body->parts, removing depth:
- mutt_prepare_template() used by postponed, resent, and draft files
- mutt_copy_body() used by the recvattach menu and $forward_attachments.
I believe it is safe to completely remove the "content->parts =
NULL" statement. But for safety, am doing so only for the case
it must be avoided: message attachments.
Richard Russon [Tue, 1 Oct 2019 10:13:08 +0000 (11:13 +0100)]
merge: fix new mail behaviour
Fix a number of regressions to do with new mail.
* fix: mbox_check_stats() retvals
* fix mbox's handling of new mail
* fix <change-folder> when $change_folder_next is set
* fix sidebar colour for 'new' mailboxes
* change check_stats() to return number of new emails
Richard Russon [Mon, 30 Sep 2019 11:43:11 +0000 (12:43 +0100)]
merge: refactor use of curses
Tidy:
* eliminate curses from Progress Bar
* move colour definitions to color.h
* tidy naming of color functions
* move KeyEvent out of mutt_curses.h
Refactor:
* SET_COLOR() to mutt_curses_set_color()
* NORMAL_COLOR() to mutt_curses_set_color()
* ATTR_SET() to mutt_curses_set_attr()
* curs_set() to mutt_curses_set_cursor()
* beep() to mutt_beep()
* addch() to mutt_window_addch()
* addnstr() to mutt_window_addnstr()
* addstr() to mutt_window_addstr()
* clrtobot() to mutt_window_clrtobot()
* move() to mutt_window_move_abs()
* printw() to mutt_window_printf()
* mutt_window_mvaddstr()
* clearok() to mutt_window_clear_screen()
* mutt_window_getxy() to mutt_window_get_coords()
Richard Russon [Fri, 27 Sep 2019 15:03:52 +0000 (16:03 +0100)]
refactor: move() to mutt_window_move_abs()
Encapsulate a curses function to reduce dependencies.
This function works with absolute screen coordinates rather than coords
based on a MuttWindow. This function should be eliminated soon.
Richard Russon [Sat, 21 Sep 2019 17:15:03 +0000 (18:15 +0100)]
merge: fix coverity defects
* config: expand flags typedef
* fix Slist usage
* nntp: check pointers
* fix pointer checks in generate_body()
* fix leak in imap_parse_path()
* fix leak in mutt_attach_mail_sender()
* fix pointer checks in rfc2047_decode()
* check the buffer in enriched_putwc()
* fix var type in text_enriched_handler()
* check retval of mutt_str_atoui()
* check the buffer in enriched_puts()
* ensure that the buffer always exists in mutt_buffer_alloc()
Richard Russon [Tue, 17 Sep 2019 10:44:51 +0000 (11:44 +0100)]
fix: crash in index
Before displaying a message, we check that `Context->mailbox` isn't
`NULL`. However, events in `mutt_display_message()` can cause the
`Context` to be closed.
Richard Russon [Fri, 13 Sep 2019 23:15:52 +0000 (00:15 +0100)]
fix: mutt_any_key_to_continue()
Originally, this function relied on `fflush(stdin)` to clear the input
buffer, but that isn't portable. This version changes the terminal
settings, temporarily, so that it can read single characters without
blocking, or line-buffering.
Richard Russon [Sun, 15 Sep 2019 15:33:55 +0000 (16:33 +0100)]
merge: upstream buffer refactoring
* Convert mutt_display_message() to buffer pool
* Convert mutt_save_message() to use buffer pool
* Convert recvattach save_attachment functions to use buffer pool
* Convert query_pipe_attachment to use buffer pool
* Convert print_attachment_list to use buffer pool
Kevin McCarthy [Wed, 11 Sep 2019 22:55:01 +0000 (15:55 -0700)]
Convert mutt_display_message() to buffer pool
Remove an unused mime-type string generation at the top of the
function too. The code using the mime type was removed a long time
ago in commit 246198ae.
Richard Russon [Wed, 11 Sep 2019 14:41:48 +0000 (15:41 +0100)]
merge: trivial fixes
* rename TunnelSockData fd members
* compose: fix nntp field clearing
* boolify: print_enriched_string()
* boolify: mutt_simple_format()
* menu: use Help and Message windows directly
Pietro Cerutti [Mon, 2 Sep 2019 09:44:21 +0000 (09:44 +0000)]
Implement mutt_date_epoch()
Closes: #1824
- Use mutt_date_epoch() instead of time()
- Use mutt_date_epoch_ms in progress
- Undo type conversion, avoid double call to mutt_date_epoch
- Give a magic number a name