While this should not affect C code, it affects unfortunately the
tooling.
This specific instance triggers a "syntax error" in Cppcheck, so it
could hide other problems.
(Cppcheck version 1.86, code parsed with `--language=c --std=c99`)
Of course it is a bug in Cppcheck, but renaming the variable is the most
pragmatic approach, as the bug in Cppcheck does not manifest itself in
a simple program.
Pietro Cerutti [Thu, 6 Jun 2019 13:51:36 +0000 (13:51 +0000)]
Optionally use pkg-config for 3rd party dependencies
Add a new --pkgconf switch to configure.
When specified, the compiler and linker flags for most 3rd party dependencies
will be figured out using pkg-config.
Richard Russon [Mon, 24 Jun 2019 15:39:55 +0000 (16:39 +0100)]
merge: upstream fixes
* Convert last rfc1524_expand_command caller to use a Buffer
* Convert rfc1524_expand_command() implementation to use struct Buffer
* Rename mutt_buffer_rfc1524_expand_command()
* Fix send-mode printing when expand_filename() returns 1
* Fix compose and edit attachment symlink failure code
* Remove unnecessary strcmp for mutt_view_attachment()
* Remove mutt_rfc1524_expand_filename() return value and checks
* Make sure mailcap test %s is sanitized
* Clean up mutt_print_attachment() cleanup
* Add NULL checks to rfc1524_free_entry()
* Detail the documentation of %l for index_format
Kevin McCarthy [Sat, 22 Jun 2019 20:33:11 +0000 (13:33 -0700)]
Remove mutt_rfc1524_expand_filename() return value and checks
The return value was of dubious value. It returned 0 only for the
case that a nametemplate was specified and it already matched the
supplied oldfile.
However, just because the nametemplate matched does not mean
attachment handling in send-mode should skip the mutt_adv_mktemp()
conversion, which includes a call to mutt_sanitize_filename(). We
didn't do so if *no* nametemplate was supplied.
Remove the return value from the function, and remove the checks and
"special handing" in mutt_attach.c calls.
Kevin McCarthy [Sat, 22 Jun 2019 19:54:40 +0000 (12:54 -0700)]
Remove unnecessary strcmp for mutt_view_attachment()
mutt_rfc1524_expand_filename() runs the result through
mutt_adv_mktemp(), which will sanitize and relocate the filename under
$tmpdir. The strcmp() is unneeded and distracting to the program
logic; none of the other routines perform or need this check.
Kevin McCarthy [Sat, 22 Jun 2019 17:09:02 +0000 (10:09 -0700)]
Fix send-mode printing when expand_filename() returns 1
It will return this when a nametemplate entry already matched the
passed in filename. So this bug required both a print entry and an
already matching nametemplate entry to trigger.
Richard Russon [Sun, 16 Jun 2019 00:32:52 +0000 (01:32 +0100)]
merge: upstream fixes
* Improve imap_append_message() error message handling
* Mention sources for ~p and ~P patterns
* Allow imap_cmd_finish() to both expunge and fetch new mail
* Improve $reverse_realname documentation
* Add $fcc_before_send, defaulting unset
Kevin McCarthy [Tue, 11 Jun 2019 20:15:22 +0000 (13:15 -0700)]
Add $fcc_before_send, defaulting unset
When set, the message will be Fcc'ed the same as sent. $fcc_clear and
$fcc_attach will be ignored. This is because of the difficulty of
unwinding changes, notably Protected Headers, without potentially
breaking signatures.
Kevin McCarthy [Mon, 10 Jun 2019 21:51:50 +0000 (14:51 -0700)]
Allow imap_cmd_finish() to both expunge and fetch new mail
Since commit dd327606 changed check_status setting to use bit
operators, and imap_check_mailbox() can call imap_cmd_finish() twice,
there is no reason to delay the processing of new mail until a second
call.
imap_read_headers() deals with msn_end < msg_begin, so remove
the (count > idata->max_msn) check. This will allow the reopen flag
to be reset if somehow it's not the case.
If the rc is IMAP_CMD_BAD, then either idata->buf is stale or an error
message has already been printed (in cmd_handle_untagged()).
Use imap_next_word() to skip over the next two words instead of
directly skipping over SEQLEN, in case the buffer is in a different
format. We don't want to jump over the end of string.
Skip the mutt_error() if there is nothing to print.
Richard Russon [Sun, 9 Jun 2019 15:23:55 +0000 (16:23 +0100)]
add slist type
Add a string list type. This manages strings delimited by space, comma
or colon. The NeoMutt code doesn't need to parse the string any more,
it's simply presented with a STAILQ (list) of strings.
Richard Russon [Sun, 9 Jun 2019 10:26:23 +0000 (11:26 +0100)]
drop dt_command
The DT_COMMAND type is unnecessary; it behaves exactly the same as DT_STRING.
Only the NeoMutt code needs to make the distinction, so use a subclass
of DT_STRING instead of a separate type.
Richard Russon [Sun, 9 Jun 2019 10:21:53 +0000 (11:21 +0100)]
drop dt_path
The DT_PATH type is unnecessary; it behaves exactly the same as DT_STRING.
Only the NeoMutt code needs to make the distinction, so use a subclass
of DT_STRING instead of a separate type.
Richard Russon [Sun, 9 Jun 2019 01:07:00 +0000 (02:07 +0100)]
move redraw flags
Move the redraw flags from a general flags field to the type field.
These GUI flags don't belong in the config definition, but once the
notification system is complete, the flags will be obsolete.
Richard Russon [Fri, 7 Jun 2019 11:20:03 +0000 (12:20 +0100)]
merge: trivial fixes
* fix folder use in mx_path_canon()
* doxy: fix typos
* rename local variable for clarity
* test: tidy code
* refactor #ifdef'd conditional
* check includes with iwyu