Austin Ray [Tue, 27 Nov 2018 03:07:38 +0000 (22:07 -0500)]
notmuch: don't overwrite nm_default_uri
In commit 1040935, I accidentally removed a check for using `Folder` as
the `db_filename` if `db_filename` is null. My change made it so that it
always overwrote the value.
Richard Russon [Mon, 26 Nov 2018 18:29:31 +0000 (18:29 +0000)]
merge: upstream changes
* Add mutt_buffer_mktemp() transition function
* Add mutt_buffer_adv_mktemp() transition function
* Always print mutt_buffer_pool_free() size debug output
* add Buffer fixup functions
* Remove conversion of nbsp to space
* Ensure a resized empty buffer is null-terminated
* Fix memleaks of saslconn on error paths
* Fix memory leak on error in eat_regexp() and eat_date()
* Document send-hooks are not executed for resumed messages
* Fix a few memory leaks for idna conversion
* Allow relative date hour/min/sec offsets
* Add some brief documentation on OAUTH support
* Update $index_format cross-references in manual
* Add L10N comments to several unclear messages
* Switch color chunk matching to use bsearch
Kevin McCarthy [Mon, 19 Nov 2018 03:13:20 +0000 (19:13 -0800)]
Switch color chunk matching to use bsearch
Emails with extremely long lines, combined with a large number of
color matches, can cause a performance hit so severe that mutt appears
to have hung.
Switching out to using a binary search speeds things up noticably.
The for loops being replaced were a bit strange. resolve_types()
ensures there are no overlaps, and that they are ordered. A match is
defined by (first <= cnt < last). I can't see any reason for the
strange comparison of (cnt > last) follow by (cnt != last). Perhaps
at one time it made sense.
Peter Wu [Tue, 23 Oct 2018 10:29:26 +0000 (12:29 +0200)]
Fix memleaks of saslconn on error paths
If mutt_sasl_client_new returns an error, the callers would ignore the
allocated saslconn resource from sasl_client_new. Be sure to release
these with sasl_dispose as documented in sasl.h. Likewise, let callers
(POP/IMAP) dispose the resource on their error paths. SMTP was already
taken care of. Found with LeakSanitizer in IMAP.
Kevin McCarthy [Wed, 17 Oct 2018 00:35:54 +0000 (17:35 -0700)]
Ensure a resized empty buffer is null-terminated
The new buffer code is using the pool, which ensures its buffers are
null-terminated.
However, if a "new" buffer from another part of the code were passed
to one of the temporary interfaces that resizes the buffer, it's
possible a non-terminated string might end up being passed through.
It's reasonable to expect mutt_b2s() for a "new" buffer should be the
same as after it is resized larger. So ensure the resulting buf->data
is properly terminated to avoid surprises.
Kevin McCarthy [Tue, 16 Oct 2018 23:04:57 +0000 (16:04 -0700)]
Remove conversion of nbsp to space
Keep the behavior of it not line-breaking, but don't change it to a
space character when displaying. This is so copy-paste from the pager
will preserve the nbsp, which is semantically important in some
locales.
Joey Pabalinas [Sun, 25 Nov 2018 20:01:40 +0000 (10:01 -1000)]
doc: correct pattern asterisk counts
The patterns ~b, ~B, and ~h read each message in and should have 4
asterisks instead of 3 (3 refers to patterns with message number range
arguments). Add the missing asterisk to these patterns.
Mehdi Abaakouk [Thu, 22 Nov 2018 08:13:23 +0000 (09:13 +0100)]
imap: handle EXPUNGE and EXISTS during one pipeline
Receiving EXPUNGE, VANISHED and EXISTS during the same imap pipelined
command is perfectly valid.
Currently when EXPUNGE/VANISHED is handled we ignore EXISTS, making
msn_index not updated. Then MUTT_REOPEN refreshes the mailbox where last
received messages are missing.
Richard Russon [Thu, 22 Nov 2018 13:46:30 +0000 (13:46 +0000)]
merge: factor out Context
* notmuch: factor out Context
* factor out Context from msg_padding_size()
* factor out Context from tags_commit()
* factor out Context from tags_edit()
* factor out Context from mx_tags_is_supported()
* light tidying
* move Context flags to Mailbox
* factor out Context from mx_msg_commit()
* factor out Context from mutt_newsgroup_catchup()
* factor out Context from mutt_newsgroup_uncatchup()
* factor out Context from find_subject()
* factor out Context from make_subj_hash()
* factor out Context from check_subjects()
* factor out Context from mbox_open_append()
* factor out Context from mutt_messages_in_thread()
* factor out Context from link_threads()
* factor out Context from mx_toggle_write()
* factor out Context from mutt_score_message()
* factor out Context from maildir_update_flags()
* factor out Context from mutt_check_rescore()
* factor out Context from mutt_prepare_template()
* factor out Context from append_message()
* factor out Context from mutt_append_message()
* factor out Context from mutt_set_flag_update()
* factor out Context from mutt_copy_message_ctx()
* factor out Context from mutt_save_message_ctx()
* factor out Context from mutt_make_message_attach()
* factor out Context from trash_append()
* factor out Context from edit_or_view_one_message()
Pietro Cerutti [Tue, 20 Nov 2018 15:16:22 +0000 (15:16 +0000)]
Keep adata on imap-logout-all
The former call to `imap_adata_free((void **) adata);` caused an account to be around with no adata associated with it. This caused a crash when trying to access the account later on.
Mehdi Abaakouk [Mon, 19 Nov 2018 14:17:27 +0000 (15:17 +0100)]
imap: reduce complexity of imap_exec
imap_exec flag IMAP_CMD_FAIL_OK is the only one that configure the
function return instead of the function behavior.
Also returned value of the function depends on the flag make hard to
understand what happen after imap_exec() is run.
This change removes this flags, instead we always returns the detailed
returns code, the caller have to deal with it.
Return code are always IMAP_EXEC_SUCCESS/IMAP_EXEC_ERROR/IMAP_EXEC_FATAL and
depends on if the command succeed, failure or if the imap connection
fail.