Ralph Corderoy [Thu, 2 Nov 2017 13:57:23 +0000 (13:57 +0000)]
Use #include with `""' for including nmh's source.
Compilers vary on how they handle #includes with `""' and `<>', but
consistency on using `""' for nmh's files, and `<>' for the system's,
means it's easy to tell which is which at a glance.
Ken Hornstein [Sat, 4 Nov 2017 13:59:18 +0000 (09:59 -0400)]
Use va_copy() to get a copy of va_list, instead of using original.
netsec_vprintf() can call vsnprintf() twice if the outgoing buffer is
full (but it happens rarely in practice, given the way the current
code uses it). But if this DOES happen, vsnprintf() will use the
same va_list argument twice, and the second time around either it will
grab a random bit of memory off of the stack OR it will segfault.
So we always use va_copy() to get our own copy of the passed-in va_list
and work on that.
Ralph Corderoy [Thu, 2 Nov 2017 01:46:26 +0000 (01:46 +0000)]
md5.c, md5.h: Reformat and delete needless portability.
The algorithm is not going to change, bugs are unlikely to appear in the
upstream RSA version, so reformat the source to be more readable, and
delete portability code now we have function prototypes with parameters,
void pointer, etc.
Ralph Corderoy [Thu, 2 Nov 2017 00:34:18 +0000 (00:34 +0000)]
repl.c, replsbr.c: Move shared data into header file.
repl.c declared global variables, and replsbr.c had extern statements
that hopefully matched them. But they're really inputs into replsbr.c's
code, so move the declarations into a new header file that both then
include, and define them in replsbr.c.
Ralph Corderoy [Wed, 1 Nov 2017 11:39:37 +0000 (11:39 +0000)]
send.c, whatnowsbr.c: Delete option variables set but never read.
Some options are passed on without the code parsing the options having
to act upon their value. These don't need to store the option's Boolean
value in a local variable that's never read.
Ralph Corderoy [Mon, 30 Oct 2017 20:29:29 +0000 (20:29 +0000)]
Replace adios(NULL, ...) with die(...).
It's the common case, and saves having to skip over the NULL when
reading, and avoids the risk of the format string being passed as the
first parameter by mistake.
Ralph Corderoy [Mon, 30 Oct 2017 19:52:11 +0000 (19:52 +0000)]
mhbuild.man: Avoid using format-free printf(3) in example.
It pops up in searches for printf()s that could be fputs(),
and as printf() it doesn't output the trailing `\n' to end the line.
Replace with puts(). Lowercase Kernighan's message, as he wrote it.
Ralph Corderoy [Sat, 28 Oct 2017 22:04:54 +0000 (23:04 +0100)]
msgchk.c: Rewrite checkmail(), removing need for macros.
NONEOK, MMDFOLD, etc., were only used to track simple Boolean
conditions. Rewriting the function removes the need for them, and gives
shorter, more clear, code. The macros pre-date git's history.
Ralph Corderoy [Sat, 28 Oct 2017 12:57:00 +0000 (13:57 +0100)]
whatnow: Remove undocumented printf-formatting of -prompt string.
whatnow(1)'s -prompt option would use the value as a printf(3) format
string, supplying `invo_name' as the sole value to be formatted. This
was undocumented, and upset gcc's checking of format strings. As no
requests to keep the ability appeared on nmh-workers in reply to
2017-08-09's email, treat -prompt's value as a simple string.
Ralph Corderoy [Sat, 28 Oct 2017 11:38:05 +0000 (12:38 +0100)]
SPECS: Alter description to not require a GUI interface.
xmh or exmh are optional, not required to use nmh. Mention them both,
but remove the dependency on whether either is available as a package.
Add possible search terms, e.g. `MIME' and `shell'.
Ralph Corderoy [Fri, 27 Oct 2017 11:28:28 +0000 (12:28 +0100)]
configure.ac: Test for libtinfo to resolve setupterm(3).
ncurses 6.0+20170902-2 on Arch Linux doesn't provide setupterm(); it
did in earlier versions. This stops ./configure finding a suitable
library. Add tinfo to the search list, as that's the lower-level
library that contains setupterm() now, and place it before curses and
ncurses so the search stops if it's sufficient instead of the larger
libraries.
Ralph Corderoy [Tue, 26 Sep 2017 20:14:06 +0000 (21:14 +0100)]
msgchk.c: Remove UUCP tests; unused since `#ifdef MF'.
The values UUCPOLD et al are never set so don't bother testing for them.
They haven't be possible in git's history. They were guarded in the
past by `#ifdef MF'; that stood for `mail filter'.
Ralph Corderoy [Fri, 27 Oct 2017 12:44:26 +0000 (13:44 +0100)]
imaptest.c: Don't test possibly uninitialised local variable.
get_imap_response() doesn't necessarily set the content of a non-NULL
`char **status'. Do this before calling, and check if it's been set to
non-NULL before using upon return.
Ken Hornstein [Wed, 25 Oct 2017 03:16:31 +0000 (23:16 -0400)]
Rototill snoop support so it works at flush time.
Before on writes, the output snoop support would only work when it was
doing netsec_vprintf(). Do it at flush time, so it should work for
any type of write.
Ken Hornstein [Tue, 24 Oct 2017 18:47:19 +0000 (14:47 -0400)]
Add context information to SASL callback.
Provide an extra context argument for the SASL negotiation callback
that application code can use to pass down information that the
callback might need.
Ralph Corderoy [Sun, 24 Sep 2017 13:26:02 +0000 (14:26 +0100)]
inc/test-eom-align: Create test mboxes in less steps.
Use a couple of temporary files created at the beginning to allow runs
of alternating cat(1) and echo(1) to be a single cat. Knocks 15% off
the `make check' time for that single test in a simple trial here.