]> granicus.if.org Git - mutt/log
mutt
5 years agoConvert smime_invoke_import() and helpers to use buffer pool. master
Kevin McCarthy [Sun, 27 Oct 2019 07:47:55 +0000 (15:47 +0800)]
Convert smime_invoke_import() and helpers to use buffer pool.

5 years agoConvert smime_verify_sender() and helpers to use buffer pool.
Kevin McCarthy [Sun, 27 Oct 2019 05:28:59 +0000 (13:28 +0800)]
Convert smime_verify_sender() and helpers to use buffer pool.

5 years agoConvert smime_get_candidates() to use buffer pool.
Kevin McCarthy [Sun, 27 Oct 2019 03:09:00 +0000 (11:09 +0800)]
Convert smime_get_candidates() to use buffer pool.

5 years agoConvert mutt_write_fcc() to use buffer pool.
Kevin McCarthy [Sat, 26 Oct 2019 11:36:33 +0000 (19:36 +0800)]
Convert mutt_write_fcc() to use buffer pool.

5 years agoConvert _mutt_bounce_message to use buffer pool.
Kevin McCarthy [Fri, 25 Oct 2019 11:29:56 +0000 (19:29 +0800)]
Convert _mutt_bounce_message to use buffer pool.

5 years agoConvert send_msg() $sendmail_wait to use buffer pool.
Kevin McCarthy [Fri, 25 Oct 2019 11:13:50 +0000 (19:13 +0800)]
Convert send_msg() $sendmail_wait to use buffer pool.

5 years agoConvert transform_to_7bit() to use buffer pool.
Kevin McCarthy [Fri, 25 Oct 2019 07:55:49 +0000 (15:55 +0800)]
Convert transform_to_7bit() to use buffer pool.

5 years agoConvert mutt_message_to_7bit() to use buffer.
Kevin McCarthy [Fri, 25 Oct 2019 07:28:25 +0000 (15:28 +0800)]
Convert mutt_message_to_7bit() to use buffer.

Clean up the error handling a bit.

Because of the recursive invocation, avoid the buffer pool in this
case.

5 years agoConvert fcc to a buffer.
Kevin McCarthy [Thu, 24 Oct 2019 06:46:06 +0000 (14:46 +0800)]
Convert fcc to a buffer.

This affects the send.c flow (ci_send_message()), the compose menu,
and various helper functions.

5 years agoConvert send_message() to use buffer pool.
Kevin McCarthy [Thu, 24 Oct 2019 03:23:20 +0000 (11:23 +0800)]
Convert send_message() to use buffer pool.

5 years agoAdd typelen parameter to rfc1524_mailcap_lookup().
Kevin McCarthy [Wed, 23 Oct 2019 11:17:09 +0000 (19:17 +0800)]
Add typelen parameter to rfc1524_mailcap_lookup().

Because of mime_lookup commands, the call to mutt_check_lookup_list()
inside the function can modify the passed in type.  Add an explicit
length parameter to the function, rather than assume the parameter
size.  This also makes it more evident the type parameter can be
modified to callers.

Change the len parameter to mutt_check_lookup_list() to type size_t,
just to be correct about it.

5 years agoConvert rfc1524_mailcap_lookup() to use buffer pool for path.
Kevin McCarthy [Wed, 23 Oct 2019 11:01:17 +0000 (19:01 +0800)]
Convert rfc1524_mailcap_lookup() to use buffer pool for path.

Adjust the rfc1524_mailcap_parse() and get_field_text() filename and
type parameters to be const.

Note that the sizeof(type) needs to be passed to
rfc1524_mailcap_lookup().  I'll fix that next.

5 years agoConvert mutt_attach_reply() to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 08:03:56 +0000 (16:03 +0800)]
Convert mutt_attach_reply() to use buffer pool.

5 years agoConvert attach_forward_msgs() to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 07:36:59 +0000 (15:36 +0800)]
Convert attach_forward_msgs() to use buffer pool.

5 years agoConvert attach_forward_bodies to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 07:04:49 +0000 (15:04 +0800)]
Convert attach_forward_bodies to use buffer pool.

5 years agoConvert attach_fmt %f to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 06:44:47 +0000 (14:44 +0800)]
Convert attach_fmt %f to use buffer pool.

5 years agoConvert mutt_num_postponed() maildir check to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 06:33:09 +0000 (14:33 +0800)]
Convert mutt_num_postponed() maildir check to use buffer pool.

5 years agoConvert pop_fetch_message() to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 05:53:26 +0000 (13:53 +0800)]
Convert pop_fetch_message() to use buffer pool.

5 years agoConvert pop_read_header() to use buffer pool.
Kevin McCarthy [Wed, 23 Oct 2019 03:39:22 +0000 (11:39 +0800)]
Convert pop_read_header() to use buffer pool.

5 years agoConvert pgp_find_hash to use buffer pool.
Kevin McCarthy [Sun, 20 Oct 2019 07:52:22 +0000 (15:52 +0800)]
Convert pgp_find_hash to use buffer pool.

5 years agoConvert pgp_make_key_attachment() to use buffer pool.
Kevin McCarthy [Sun, 20 Oct 2019 07:27:10 +0000 (15:27 +0800)]
Convert pgp_make_key_attachment() to use buffer pool.

5 years agoRemove make_key_attachment parameter.
Kevin McCarthy [Sun, 20 Oct 2019 06:06:24 +0000 (14:06 +0800)]
Remove make_key_attachment parameter.

The parameter is not actually used anywhere.  The next commit will
convert the classic pgp implementation to use the buffer pool.  This
change will simplify the logic.

5 years agoConvert pgp_select_key() to use buffer pool.
Kevin McCarthy [Sun, 20 Oct 2019 05:41:30 +0000 (13:41 +0800)]
Convert pgp_select_key() to use buffer pool.

5 years agoConvert pgp_traditional_encryptsign() to use buffer pool.
Kevin McCarthy [Sat, 19 Oct 2019 07:50:22 +0000 (15:50 +0800)]
Convert pgp_traditional_encryptsign() to use buffer pool.

5 years agoConvert pgp_encrypt_message() to use buffer pool.
Kevin McCarthy [Sat, 19 Oct 2019 07:35:06 +0000 (15:35 +0800)]
Convert pgp_encrypt_message() to use buffer pool.

5 years agoConvert pgp_sign_message to use buffer pool.
Kevin McCarthy [Sat, 19 Oct 2019 07:07:53 +0000 (15:07 +0800)]
Convert pgp_sign_message to use buffer pool.

5 years agoConvert pgp_encrypted_handler() to use buffer pool.
Kevin McCarthy [Sat, 19 Oct 2019 06:48:17 +0000 (14:48 +0800)]
Convert pgp_encrypted_handler() to use buffer pool.

5 years agoConvert pgp_decrypt_mime() to use buffer pool.
Kevin McCarthy [Fri, 18 Oct 2019 07:05:33 +0000 (15:05 +0800)]
Convert pgp_decrypt_mime() to use buffer pool.

5 years agoConvert pgp_decrypt_part() to use buffer pool.
Kevin McCarthy [Fri, 18 Oct 2019 06:41:06 +0000 (14:41 +0800)]
Convert pgp_decrypt_part() to use buffer pool.

5 years agoConvert pgp_extract_keys_from_attachment() to use buffer pool.
Kevin McCarthy [Fri, 18 Oct 2019 06:29:56 +0000 (14:29 +0800)]
Convert pgp_extract_keys_from_attachment() to use buffer pool.

5 years agoConvert pgp_verify_one() to use buffer pool.
Kevin McCarthy [Fri, 18 Oct 2019 06:21:19 +0000 (14:21 +0800)]
Convert pgp_verify_one() to use buffer pool.

5 years agoConvert pgp_check_traditional_one_body() to use buffer pool.
Kevin McCarthy [Fri, 18 Oct 2019 06:02:02 +0000 (14:02 +0800)]
Convert pgp_check_traditional_one_body() to use buffer pool.

5 years agoClean up pager change folder aborts to return to pager.
Kevin McCarthy [Thu, 17 Oct 2019 10:34:55 +0000 (18:34 +0800)]
Clean up pager change folder aborts to return to pager.

Changing folder from within the pager behaved inconsistently when
aborting, or upon a normal error.  It would sometimes return the pager
and other times return to the index.

Ensure it returns to the pager, except in the case where
mx_close_mailbox() fails due to a new mail or reopen event.  In that
case we likely want to be in the index - the message we were viewing
could have disappeared or relocated.

5 years agoRemove menu->menu hack when redirecting pager ops through index.
Kevin McCarthy [Thu, 17 Oct 2019 09:30:03 +0000 (17:30 +0800)]
Remove menu->menu hack when redirecting pager ops through index.

As noted in commit a327386c, this causes problems when redirecting ops
that open new menus.  There is no need to change the menu->menu type,
as a flag works perfectly well with no such side effects.

This also removes the need for comments explaning the hack before
mutt_folder_hooks() when changing folders, or before displaying a
message in the pager.

5 years agoMerge branch 'stable'
Kevin McCarthy [Thu, 17 Oct 2019 08:01:11 +0000 (16:01 +0800)]
Merge branch 'stable'

5 years agoStable branch quick fix for pager change-mailbox push/exec bug. stable
Kevin McCarthy [Thu, 17 Oct 2019 07:48:31 +0000 (15:48 +0800)]
Stable branch quick fix for pager change-mailbox push/exec bug.

The menu functions mutt_push/pop_current_menu() keep track of the menu
stack, automatically setting CurrentMenu when exiting menus.

The only gotcha was the function sharing between the index and pager
menus.  The index uses a hack, setting menu->menu to MENU_PAGER for
operations redirecting through the index and back to the pager
afterwards.

I thought this was covered by the restoration of the menu before
returning to the pager, or when exiting the index switch.  However it
is not: invoking other menus, such as the browser, will result in
CurrentMenu being set to the Pager when exiting those (by
mutt_pop_current_menu()).  This can result in folder hooks failing for
unshared functions.

A better fix is to remove the hack of using menu->menu, because this
can easily cause a problem in the future in other situations.  (I will
make this fix in master next.)  For the stable branch, I am explicitly
setting/restoring CurrentMenu before invoking the folder hooks.

5 years agoConvert pgp_app_handler to use buffer pool.
Kevin McCarthy [Wed, 16 Oct 2019 07:42:54 +0000 (15:42 +0800)]
Convert pgp_app_handler to use buffer pool.

Rename the pgp_copy_checksig() and mutt_wait_filter() return code
variables to provide more clarity, and to make the purpose and
assignment of rc more obvious.

Change tmpfname creation failure to be like pgpoutfile and
pgperrfile, by going to the cleanup point.

5 years agoConvert msg_search to use buffer.
Kevin McCarthy [Wed, 16 Oct 2019 06:41:04 +0000 (14:41 +0800)]
Convert msg_search to use buffer.

Avoid the buffer pool because of the long life cycle (across the
invocation of mutt_body_handler().

5 years agoConvert mx_close_mailbox() to use buffer pool.
Kevin McCarthy [Wed, 16 Oct 2019 06:13:05 +0000 (14:13 +0800)]
Convert mx_close_mailbox() to use buffer pool.

5 years agoReduce line buffer size in mx_get_magic().
Kevin McCarthy [Tue, 15 Oct 2019 07:26:20 +0000 (15:26 +0800)]
Reduce line buffer size in mx_get_magic().

tmp is only used for mbox and mmdf iniital line examination.  That
only needs to look at 6 characters from the first line.

5 years agoConvert mutt_save_confirm() to use buffer pool.
Kevin McCarthy [Tue, 15 Oct 2019 06:52:26 +0000 (14:52 +0800)]
Convert mutt_save_confirm() to use buffer pool.

These are prompts, so don't really need the larger, dynamic
capability, but it might not hurt for a larger path.

5 years agoRemoved unused mutt_expand_link()
Kevin McCarthy [Tue, 15 Oct 2019 06:38:07 +0000 (14:38 +0800)]
Removed unused mutt_expand_link()

5 years agoChange ssl_init to use buffer pool for rand filename.
Kevin McCarthy [Tue, 15 Oct 2019 06:33:02 +0000 (14:33 +0800)]
Change ssl_init to use buffer pool for rand filename.

5 years agoConvert mbox_sync_mailbox() to use buffer pool.
Kevin McCarthy [Tue, 15 Oct 2019 05:48:59 +0000 (13:48 +0800)]
Convert mbox_sync_mailbox() to use buffer pool.

Rewrite return(-1) to a new fatal target to ensure cleanup.

Remove some repetitive unlink(tempfile) operations by adding a new
flag pointing when to start and stop that during a bail.

5 years agoUpdate mime fields when piping a message with $pipe_decode set.
Kevin McCarthy [Sun, 13 Oct 2019 08:25:54 +0000 (16:25 +0800)]
Update mime fields when piping a message with $pipe_decode set.

Programs that process the message may get confused if the original
mime fields are in the output.  Add the CH_MIME flag to strip mime
headers and CH_TXTPLAIN to add decoded text mime headers in their
place, just as <decode-copy> does.

However, make sure not to add the flags when printing, as printers
highly likely won't care and users probably don't want to see those
headers in their printout.

5 years agoMerge branch 'stable'
Kevin McCarthy [Fri, 11 Oct 2019 11:31:58 +0000 (19:31 +0800)]
Merge branch 'stable'

5 years agoClear connection input buffer when closing.
Beck, Andre [Fri, 11 Oct 2019 11:17:58 +0000 (19:17 +0800)]
Clear connection input buffer when closing.

An RFC-violating reply from the Dovecot SMTP submission service
uncovered a bug in Mutt.  Mutt was not clearing out the input buffer
when closing the connection.

Dovecot was including an extra 250 response after data submission:

  DATA
  354 OK
  Subject: Test 3

  Test 3
  .
  250 2.0.0  223 byte chunk, total 223
  250 2.0.0 OK id=1iIqT1-0004wS-Ac
  quit
  221 2.0.0 Bye

The multiline 250 reply requires a hyphen in the first response.  Mutt
closes the connection after the quit, but ends up leaving the
unexpected second line in the input buffer.  This causes an error in
the next usage of the connection.

Clean out bufpos and available when closing the socket.

5 years agoAdd new browse-mailboxes function in index and pager.
Kevin McCarthy [Thu, 10 Oct 2019 07:03:05 +0000 (15:03 +0800)]
Add new browse-mailboxes function in index and pager.

This allows direct access to the mailboxes list in the folder menu.
This is useful, for instance, if $browser_sticky_cursor is set and the
current directory does not contain the open mailbox.  The macro
version will lose the current mailbox while toggling to the mailboxes
list.

5 years agoConvert main() to use buffers for paths.
Kevin McCarthy [Wed, 9 Oct 2019 04:59:41 +0000 (12:59 +0800)]
Convert main() to use buffers for paths.

Convert fpath (used for checking and creating $folder.

Convert expanded_infile and tempfile which are used for the -i,-H, and
-E options.  We allocate buffers, rather than use the pool, because
they are used for the duration of the compose/send operation.

5 years agoAdd sticky browser behavior for sorting.
Kevin McCarthy [Wed, 9 Oct 2019 00:36:59 +0000 (08:36 +0800)]
Add sticky browser behavior for sorting.

The menu isn't rebuilt after sorting, so the selected mailbox was not
sticky for that operation.

Refactor the sticky cursor setting out so it can be explicitly called
after sorting too.

5 years agoConvert start_debug() to use buffer pool.
Kevin McCarthy [Tue, 8 Oct 2019 07:22:27 +0000 (15:22 +0800)]
Convert start_debug() to use buffer pool.

5 years agoConvert set/reset and source_rc to use buffers for paths.
Kevin McCarthy [Tue, 8 Oct 2019 07:21:44 +0000 (15:21 +0800)]
Convert set/reset and source_rc to use buffers for paths.

5 years agoConvert parse_path_(un)list to use buffer pool for path.
Kevin McCarthy [Tue, 8 Oct 2019 05:07:40 +0000 (13:07 +0800)]
Convert parse_path_(un)list to use buffer pool for path.

Don't use the buf parameter to avoid stretching it out, as it's used
for the entire rc parsing, and typically just holds command names.

5 years agoChange message cache id to use SHORT_STRING.
Kevin McCarthy [Tue, 8 Oct 2019 04:28:30 +0000 (12:28 +0800)]
Change message cache id to use SHORT_STRING.

Even that is too big, but it doesn't make make sense to use
_POSIX_PATH_MAX for the id string.

5 years agoConvert imap_cachepath() and callers to use buffers.
Kevin McCarthy [Tue, 8 Oct 2019 03:24:38 +0000 (11:24 +0800)]
Convert imap_cachepath() and callers to use buffers.

5 years agoConvert imap fetch_new and fetch_message tempfiles to buffer pool.
Kevin McCarthy [Mon, 7 Oct 2019 02:39:44 +0000 (10:39 +0800)]
Convert imap fetch_new and fetch_message tempfiles to buffer pool.

5 years agoConvert imap_open_new_message() to use buffer pool.
Kevin McCarthy [Mon, 7 Oct 2019 01:55:39 +0000 (09:55 +0800)]
Convert imap_open_new_message() to use buffer pool.

5 years agoConvert save-hook and fcc-hook to use buffer pool internally.
Kevin McCarthy [Sun, 6 Oct 2019 08:32:42 +0000 (16:32 +0800)]
Convert save-hook and fcc-hook to use buffer pool internally.

The hook parameters still need to be converted, but I'm working
towards it slowly.

5 years agoConvert mutt_parse_hook() to use buffer pool.
Kevin McCarthy [Sun, 6 Oct 2019 05:37:14 +0000 (13:37 +0800)]
Convert mutt_parse_hook() to use buffer pool.

Remove the path variable, as this is not needed:
mutt_buffer_expand_path() and mutt_check_simple() can operate directly
on the pattern/command buffers.

5 years agoConvert shrink_histfile() tempfile to use buffer pool.
Kevin McCarthy [Sat, 5 Oct 2019 06:10:04 +0000 (14:10 +0800)]
Convert shrink_histfile() tempfile to use buffer pool.

5 years agoConvert mutt_help() to use buffer for tempfile.
Kevin McCarthy [Sat, 5 Oct 2019 05:59:57 +0000 (13:59 +0800)]
Convert mutt_help() to use buffer for tempfile.

5 years agoConvert mutt_edit_headers() to use buffer pool.
Kevin McCarthy [Sat, 5 Oct 2019 05:52:50 +0000 (13:52 +0800)]
Convert mutt_edit_headers() to use buffer pool.

5 years agoFix built-in pager checks for help and attachments.
Kevin McCarthy [Fri, 4 Oct 2019 07:29:03 +0000 (15:29 +0800)]
Fix built-in pager checks for help and attachments.

Mutt uses the built-in pager when $pager is unset too.  Fix a few
checks to also handle that case.

5 years agoMemcpy header cache fetch values to ensure alignment.
Kevin McCarthy [Tue, 1 Oct 2019 01:50:27 +0000 (18:50 -0700)]
Memcpy header cache fetch values to ensure alignment.

While testing the hcache buffer pool changes, I noticed a misaligned
pointer warning when using LMDB.

The other header cache backends must ensure alignment of the pointer
they return, but LMDB apparently does not.

Instead of directly assigning and dereferencing the pointer fetched,
use memcpy to the appropriate type, just as the header cache restore
operation does.

5 years agoConvert hcache delete and open calls to use buffer pool.
Kevin McCarthy [Sat, 28 Sep 2019 21:08:39 +0000 (14:08 -0700)]
Convert hcache delete and open calls to use buffer pool.

5 years agoConvert hcache fetch and store raw to use buffer pool.
Kevin McCarthy [Sat, 28 Sep 2019 02:21:26 +0000 (19:21 -0700)]
Convert hcache fetch and store raw to use buffer pool.

5 years agoConvert hcache_open to use buffer pool.
Kevin McCarthy [Sat, 28 Sep 2019 01:12:27 +0000 (18:12 -0700)]
Convert hcache_open to use buffer pool.

Change the namer function and mutt_hcache_per_folder to operate on a
buffer parameter.

5 years agoConvert hcache db4 lockfile to buffer.
Kevin McCarthy [Fri, 27 Sep 2019 22:46:49 +0000 (15:46 -0700)]
Convert hcache db4 lockfile to buffer.

5 years agoConvert run_decode_and_handler() to use buffer pool.
Kevin McCarthy [Fri, 27 Sep 2019 21:42:45 +0000 (14:42 -0700)]
Convert run_decode_and_handler() to use buffer pool.

5 years agoConvert edit_one_message() to use buffer pool.
Kevin McCarthy [Fri, 27 Sep 2019 21:28:01 +0000 (14:28 -0700)]
Convert edit_one_message() to use buffer pool.

5 years agoConvert mutt_error_history to use buffer pool.
Kevin McCarthy [Thu, 26 Sep 2019 22:23:14 +0000 (15:23 -0700)]
Convert mutt_error_history to use buffer pool.

5 years agoConvert crypt_extract_keys and signed handler to use buffers.
Kevin McCarthy [Thu, 26 Sep 2019 01:44:50 +0000 (18:44 -0700)]
Convert crypt_extract_keys and signed handler to use buffers.

5 years agoConvert crypt-gpgme to use BUFFER for tempfiles.
Kevin McCarthy [Wed, 25 Sep 2019 22:28:30 +0000 (15:28 -0700)]
Convert crypt-gpgme to use BUFFER for tempfiles.

Use the pool where possible, but when the function calls other
long-running functions (such as mutt_body_handler() or
mutt_do_pager()), allocate the buffer.

smime_gpgme_decrypt_mime() was not freeing the "cur" BODY generated on
error.  Add a call to mutt_free_body(cur) in the error handling.

5 years agoFix memory leak in compose write-fcc function.
Kevin McCarthy [Sun, 22 Sep 2019 22:59:27 +0000 (15:59 -0700)]
Fix memory leak in compose write-fcc function.

The outer multipart was not being freed after writing.

5 years agoConvert compress setup_paths() to use buffer.
Kevin McCarthy [Sun, 22 Sep 2019 22:58:58 +0000 (15:58 -0700)]
Convert compress setup_paths() to use buffer.

5 years agoRemove nonull check from _mutt_enter_fname()
Kevin McCarthy [Sun, 22 Sep 2019 21:54:14 +0000 (14:54 -0700)]
Remove nonull check from _mutt_enter_fname()

It was a mistake to add the check when converting to use buffers in
commit 70ef4e9e.

The buf must be non-null in the original version, and in this version
we are copying results back to it afterwards.

5 years agoConvert compose menu fname variable to buffer.
Kevin McCarthy [Sun, 22 Sep 2019 21:38:03 +0000 (14:38 -0700)]
Convert compose menu fname variable to buffer.

5 years agoConvert buffer callers of mutt_get_field() to use buffer version.
Kevin McCarthy [Sun, 22 Sep 2019 21:16:56 +0000 (14:16 -0700)]
Convert buffer callers of mutt_get_field() to use buffer version.

5 years agoCreate mutt_buffer_get_field().
Kevin McCarthy [Sun, 22 Sep 2019 21:11:43 +0000 (14:11 -0700)]
Create mutt_buffer_get_field().

This will reduce the buffer->dptr fiddling all over the place into one
spot until mutt_enter_string() can be converted.

5 years agoConvert compose check_attachments() to use buffer pool.
Kevin McCarthy [Sun, 22 Sep 2019 02:41:28 +0000 (19:41 -0700)]
Convert compose check_attachments() to use buffer pool.

Modify error message so that the filename comes last, to prevent a
long path from hiding the error message or prompt.

5 years agoFix mutt_save_message() "enter_fname()" to use buffer version.
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.

5 years agoMerge branch 'stable'
Kevin McCarthy [Sat, 21 Sep 2019 19:41:10 +0000 (12:41 -0700)]
Merge branch 'stable'

5 years agoautomatic post-release commit for mutt-1.12.2 mutt-1-12-2-rel
Kevin McCarthy [Sat, 21 Sep 2019 19:36:56 +0000 (12:36 -0700)]
automatic post-release commit for mutt-1.12.2

5 years agoUpdate UPDATING file for 1.12.2 release.
Kevin McCarthy [Sat, 21 Sep 2019 19:27:57 +0000 (12:27 -0700)]
Update UPDATING file for 1.12.2 release.

5 years agoConvert mutt_complete() to use the buffer pool.
Kevin McCarthy [Fri, 20 Sep 2019 01:52:24 +0000 (18:52 -0700)]
Convert mutt_complete() to use the buffer pool.

Add helper functions mutt_buffer_substrcpy() and
mutt_buffer_concatn_path().

Remove mutt_concatn_path() because mutt_complete() was the only
caller.

5 years agoImprove sidebar indentation and shortpath behavior.
Kevin McCarthy [Sun, 15 Sep 2019 22:41:42 +0000 (15:41 -0700)]
Improve sidebar indentation and shortpath behavior.

The previous implementation only enabled $sidebar_folder_indent for
mailboxes underneath $folder.  Change indentation to be based upon the
previous common-path mailbox in the list.  Indent one more than the
common-path mailbox, rather than the number of delimiters after
$folder.

Change $sidebar_short_path to shorten based on the previous mailbox in
the list too.

Invoke mutt_buffer_pretty_mailbox() to prefix the mailbox with '~' or
'=' characters.  This changes the output for the case where mailbox
equals $folder, but provides uniform display behavior across mutt.

Thanks to Christopher Zimmermann (@madroach) for the original patch,
which this commit is based upon.

5 years agoConvert print_attachment_list to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:47:13 +0000 (19:47 -0700)]
Convert print_attachment_list to use buffer pool.

5 years agoConvert query_pipe_attachment to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:40:48 +0000 (19:40 -0700)]
Convert query_pipe_attachment to use buffer pool.

5 years agoConvert recvattach save_attachment functions to use buffer pool.
Kevin McCarthy [Thu, 12 Sep 2019 02:10:02 +0000 (19:10 -0700)]
Convert recvattach save_attachment functions to use buffer pool.

Convert utility functions prepend_curdir() and mutt_check_overwrite()
to use BUFFER, as they are only used by those two functions.

5 years agoConvert mutt_save_message() to use buffer pool.
Kevin McCarthy [Wed, 11 Sep 2019 23:23:46 +0000 (16:23 -0700)]
Convert mutt_save_message() to use buffer pool.

Change imap_copy_messages() dest parameter to const char *.

mutt_default_save() will be converted to use a buffer next, removing
the dptr fixups.

5 years agoConvert mutt_display_message() to 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.

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 10 Sep 2019 01:39:19 +0000 (18:39 -0700)]
Merge branch 'stable'

5 years agoFix mutt_write_mime_body() application/pgp-encrypted handling.
Kevin McCarthy [Tue, 10 Sep 2019 01:32:59 +0000 (18:32 -0700)]
Fix mutt_write_mime_body() application/pgp-encrypted handling.

It would blindly overwrite any attachment with that type, as if it
were the version label part of a multipart/encrypted message.

However attachments with extenstion .gpg are labeled that type if
$mime_type_query_command is set to "xdg-mime query filetype".  This
would cause the attachment to be overwritten too.

Add a check for a missing body->filename, which should only be the
case for the manually constructed part.

5 years agoChange browser <display-filename> to show full_path.
Kevin McCarthy [Tue, 10 Sep 2019 01:19:03 +0000 (18:19 -0700)]
Change browser <display-filename> to show full_path.

Prior to the introduction of display_name/full_path, it showed "name",
which was the full IMAP URL but the shortname for folder/mailbox view.

Now that the full_path is available, it makes sense to show that for
all cases.

5 years agoConvert remaining mutt_encode_path() call to use BUFFER.
Kevin McCarthy [Mon, 9 Sep 2019 21:06:31 +0000 (14:06 -0700)]
Convert remaining mutt_encode_path() call to use BUFFER.

Then rename the other uses of mutt_buffer_encode_path() to
mutt_encode_path().

5 years agoMerge branch 'stable'
Kevin McCarthy [Tue, 10 Sep 2019 01:07:16 +0000 (18:07 -0700)]
Merge branch 'stable'

5 years agoAdd $browser_sticky_cursor default set.
Kevin McCarthy [Sun, 8 Sep 2019 17:49:37 +0000 (10:49 -0700)]
Add $browser_sticky_cursor default set.

This option attempts to keep the browser cursor on the same mailbox.

It does this by keeping track of the current selected mailbox and
comparing that when regenerating the menu.

Modify imap_mailbox_create() and imap_mailbox_rename() to return the
new mailbox name so it can be automatically selected.

5 years agoRename browser fields to display_name and full_path.
Kevin McCarthy [Sun, 8 Sep 2019 19:09:51 +0000 (12:09 -0700)]
Rename browser fields to display_name and full_path.

Mailbox and Folder view don't make use of the desc field.  They store
an abbreviated version in the name field and expand it when selecting
or testing it.

IMAP stores the full URL in name, and stores an abbreviated
version (possibly with a trailing slash) in the desc field.

The asymetricity makes it awkward, and interferes with a smart-cursor
option in the next commit.  So instead rename the fields to
"display_name" and "full_path".

In Mailfox and Folder view, store the fully expanded path, which we
have while iterating, in "full_path", and the shortened version in
"display_name".

Likewise in IMAP, store the full URL in "full_path" and the shortened
version in "display_name".

Simplify the code in browser.c to use the full_path instead of
concatenating and expanding.

5 years agoConvert bcache to use buffer pools.
Kevin McCarthy [Fri, 6 Sep 2019 23:14:08 +0000 (16:14 -0700)]
Convert bcache to use buffer pools.

5 years agoFix memory leak when attaching messages.
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.