Pietro Cerutti [Fri, 17 May 2019 13:42:58 +0000 (13:42 +0000)]
Provide mutt_addrlist_append and mutt_addrlist_prepend
These are one-liners that call TAILQ_INSERT_TAIL and TAILQ_INSERT_HEAD,
but the macros have the ugly side-effect of evaluating their arguments
multiple times, so TAILQ_INSERT_TAIL(list, new_element()); doesn't do
what you would expect.
Andres Freund [Tue, 21 May 2019 23:50:54 +0000 (16:50 -0700)]
Avoid redundant sort in entire-thread.
918885f added, indirectly, a mutt_sort_headers() call to
nm_read_entire_thread() (via mutt_mailbox_changed() ->
ctx_mailbox_changed() -> ctx_update()), but didn't remove the sort
after nm_read_entire_thread() in mutt_index_menu().
Andres Freund [Tue, 21 May 2019 23:13:10 +0000 (16:13 -0700)]
entire-thread: determine current position before resorting.
Previously oldcur was determined after nm_read_entire_thread(),
leading to entire-thread unintentionally jumping to the first message
in the thread.
Before 918885f32db41 that used to work, because mutt_sort_headers()
wasn't called from within nm_read_entire_thread().
Fix by moving determination of pre nm_read_entire_thread() count a few
lines up. Also reuse existing oldcount variable, rather than
'oc' (which could also be oldcur).
Richard Russon [Thu, 16 May 2019 11:55:40 +0000 (12:55 +0100)]
don't check for empty config strings
The config system stores empty strings as NULL.
Config variables must not be set directly, but using the config system
(this gives us validation and notifications).
Richard Russon [Thu, 16 May 2019 10:29:49 +0000 (11:29 +0100)]
merge: upstream fixes
* Fix sample neomuttrc to use better quoting practices.
* Add a "backticks in double quotes" example to the manual.
* Avoid undefined behaviour on huge integer in a RFC2231 header
* sync pgp_gpgme_invoke_import()
Vincent Lefevre [Wed, 15 May 2019 11:05:09 +0000 (13:05 +0200)]
Avoid undefined behaviour on huge integer in a RFC2231 header
The atoi() function was called on the index, which can potentially
be huge in an invalid message and can yield undefined behavior. The
mutt_atoi() function is now used for error detection.
Pietro Cerutti [Mon, 13 May 2019 11:42:37 +0000 (11:42 +0000)]
Do not cache a compiled regex to avoid leaks
glibc's implementation of the regex engine is a DFA which creates nodes
on the fly under the regex_t object. This will cause leakes if we keep
the compiled regular expression around, as it was the case before.
See also https://sourceware.org/bugzilla/show_bug.cgi?id=12567
Austin Ray [Fri, 10 May 2019 00:05:22 +0000 (20:05 -0400)]
feat: use mailbox description for spoolfile
'spoolfile' is limited to mailboxes paths so if one wants to use a
'named-mailboxes' or 'virtual-mailboxes' as the spoolfile, its path must
be duplicated in the 'spoolfile' assignment. 'virtual-mailboxes' has a
helper variable, 'virtual_spoolfile', for selecting the first
'virtual-mailboxes' entry as the spoolfile.
This commit allows one to use a mailbox description for the 'spoolfile,
which removes the need to duplicate a 'named-mailboxes' or
'virtual-mailboxes' path and makes 'virtual_spoolfile' defunct. The
configuration syntax is now more consistent.
It is important to note that mailbox descriptions are preferred to
paths.
To reflect the change, documentation was updated:
- Add note to 'spoolfile' about using a string to specify a
'named-mailboxes' or 'virtual-mailboxes' description.
- Add a note to the 'virtual_spoolfile' documentation saying that it is no
longer necessary since 'spoolfile' supports descriptions now.
Richard Russon [Fri, 10 May 2019 14:16:58 +0000 (15:16 +0100)]
merge: upstream fixes
* Add a test for NULL parameter attribute too
* Add a quick-starter config section to the manual.
* Add sample starter muttrc to contrib.
* Change sample muttrc path to match other manual references.
* Add note about %r for the pgp_list_*_command vars.
Kevin McCarthy [Thu, 9 May 2019 20:25:25 +0000 (13:25 -0700)]
Change sample muttrc path to match other manual references.
The other parts of the manual refer to /usr/local/share/doc in their
examples. For consistency, change the starter muttrc and manual entry
to do the same.
In the future, we may wish to have a config variable instead, so users
don't have to worry about system vs locally installed paths when
sourcing the gpg.rc, for instance.