]>
diplodocus.org Git - nmh/log
Paul Fox [Sat, 2 Sep 2017 13:13:44 +0000 (09:13 -0400)]
Change the priority ordering for multiple -prefer switches
Interpreting multiple -prefer switches in ascending priority
order allows the command line to override the user's profile.
Ralph Corderoy [Mon, 4 Sep 2017 11:01:35 +0000 (12:01 +0100)]
man: Use `.IR' for `foo(1)', not the few `.BR'.
Ralph Corderoy [Mon, 4 Sep 2017 10:59:48 +0000 (11:59 +0100)]
man: Change the tautological `the foo(1) man page' to `foo(1)'.
Ralph Corderoy [Mon, 4 Sep 2017 09:42:17 +0000 (10:42 +0100)]
oauth: Replace `if...return false; return true' with `return ...'.
In functions returning bool, these are equivalent.
Before: After:
if (!foo()) return foo();
return false;
return true;
Ralph Corderoy [Mon, 4 Sep 2017 09:29:21 +0000 (10:29 +0100)]
oauth.c: Remove unused assignments of function return value.
`if ((status = foo()) != OK) return false;' doesn't need to set local
variable status.
Ralph Corderoy [Mon, 4 Sep 2017 09:07:35 +0000 (10:07 +0100)]
Replace FALSE and TRUE with C99's false and true.
Remove the duplicate definitions of FALSE and TRUE. Change a few
variables from int to bool at the same time. The semantics of bool are
different to int because `bool b = 42' maps 42 to 1, but if the code was
relying on that then it needs shaking out anyway.
Ralph Corderoy [Mon, 4 Sep 2017 09:03:36 +0000 (10:03 +0100)]
print_intro(): Change parameter brief from int to bool.
Ralph Corderoy [Sun, 3 Sep 2017 22:37:52 +0000 (23:37 +0100)]
flist.c: Use bool instead of int for some of the flags.
Ralph Corderoy [Sun, 3 Sep 2017 22:29:36 +0000 (23:29 +0100)]
Replace boolean with bool everywhere.
boolean's comment said it existed to ensure storage was a char and not
an int so it could be packed in a struct, but the only struct using it
doesn't care about the space taken.
Ralph Corderoy [Sun, 3 Sep 2017 14:41:04 +0000 (15:41 +0100)]
mh.h: Always define NMH_UNUSED as a cast to void.
The not-gcc-or-earlier-than-gcc-2 version was the identity function
seems unnecessary as what C99 compiler would complain about a cast to
void?
Ralph Corderoy [Sun, 3 Sep 2017 14:38:44 +0000 (15:38 +0100)]
mh.h: Move the gcc-4.3-conditional macro definitions.
Having them outside of the gcc-2 ones makes the logic easier to follow
as there's no nesting.
Ralph Corderoy [Sun, 3 Sep 2017 12:35:34 +0000 (13:35 +0100)]
dropsbr.c: Remove unused ntohl() macro, and its NTOHLSWAP test.
Not used since
e6c91771 removed support for ./.foo.map index for ./foo
mailbox.
Ralph Corderoy [Sun, 3 Sep 2017 12:32:24 +0000 (13:32 +0100)]
fakehttp.c: Remove unused LINESIZE macro; never used.
Ralph Corderoy [Sun, 3 Sep 2017 12:30:34 +0000 (13:30 +0100)]
config.c: Remove unused nmhdocdir() macro.
Ralph Corderoy [Sun, 3 Sep 2017 11:23:14 +0000 (12:23 +0100)]
ap.c, dp.c: exit(3) with 0 or 1, not [0, MAX_EXIT].
Don't attempt to indicate the number of failures through the exit status
as that's too constrained. Just stick to zero for none, and 1 for some.
Delete, the now unused, MAX_EXIT.
Ralph Corderoy [Sun, 3 Sep 2017 11:18:59 +0000 (12:18 +0100)]
DEFAULT_PAGER: Move from nmh.h to mh.h. Former is "config.h".
The macro isn't related to platform independence, unlike the rest of
nmh.h, that starts by including config.h.
Ralph Corderoy [Sat, 2 Sep 2017 23:22:18 +0000 (00:22 +0100)]
geteditor.c: Hard-code the default, "vi".
It was the only use of the DEFAULT_EDITOR macro, so that can be deleted.
Ralph Corderoy [Sat, 2 Sep 2017 17:49:11 +0000 (18:49 +0100)]
Move base64.c's prototypes from prototypes.h to new base64.h.
Ralph Corderoy [Sat, 2 Sep 2017 16:38:33 +0000 (17:38 +0100)]
mhbuild.man: Fix grammar indentation by expanding tabs.
The grammar is pre-formatted using spaces for indentation.
A few lines had switched to tabs in
9b706433f .
Ralph Corderoy [Sat, 2 Sep 2017 12:55:29 +0000 (13:55 +0100)]
decodeBase64(): Limit length of error message on invalid input.
Screenfuls of email were appearing on stderr.
David Levine [Tue, 29 Aug 2017 01:03:21 +0000 (21:03 -0400)]
Restrict use of alloc_size function attribute to gcc >= 4.3.0.
It's not supported by gcc 4.2.4. CHECK_PRINTF doesn't work
perfectly with gcc 4.2.1, so disable that with gcc < 4.3.0 as
well. Fix to commit
c066b395274021182a5f0530ccfeb1bcd167d860 .
Ralph Corderoy [Mon, 28 Aug 2017 18:57:16 +0000 (19:57 +0100)]
Move read_line.c's prototypes from prototypes.h to new read_line.h.
Add copyright comment to start of read_line.c whilst there.
Ralph Corderoy [Mon, 28 Aug 2017 18:47:23 +0000 (19:47 +0100)]
Add ENDNULL macro for gcc's `sentinel' function attribute.
Annotate a few prototypes with it.
Ralph Corderoy [Mon, 28 Aug 2017 18:33:53 +0000 (19:33 +0100)]
Move terminal.c's prototypes from prototypes.h to new terminal.h.
Ralph Corderoy [Mon, 28 Aug 2017 17:13:17 +0000 (18:13 +0100)]
Fix spelling in comment.
Ralph Corderoy [Mon, 28 Aug 2017 17:09:59 +0000 (18:09 +0100)]
read_switch_multiword.c: siglongjmp(3) removes need for `else'.
Ralph Corderoy [Mon, 28 Aug 2017 17:08:31 +0000 (18:08 +0100)]
mhlsbr.c: Don't need to `else' after longjmp() at end of then-block.
Ralph Corderoy [Mon, 28 Aug 2017 17:05:41 +0000 (18:05 +0100)]
Remove comment asking if siglongjmp(3) should be used; it is.
77a8a873b switched from longjmp(3).
Ralph Corderoy [Mon, 28 Aug 2017 17:00:11 +0000 (18:00 +0100)]
Don't need to `else' after mhladios() at end of then-block.
Ralph Corderoy [Mon, 28 Aug 2017 16:57:04 +0000 (17:57 +0100)]
Give mhldone() and mhladios() the NORETURN function attribute.
And remove `FALLTHRU' comments after their calls.
Ralph Corderoy [Mon, 28 Aug 2017 16:53:15 +0000 (17:53 +0100)]
Don't cast zero to pid_t for setpgid(2)'s first argument.
Ralph Corderoy [Mon, 28 Aug 2017 16:52:12 +0000 (17:52 +0100)]
Don't cast zero to char for storing at pointer to char.
Ralph Corderoy [Mon, 28 Aug 2017 16:49:29 +0000 (17:49 +0100)]
Don't cast zero to a non-function pointer; use NULL instead.
Better still, omit it when BSS does the job, or C's treatment of
non-zero as true is sufficient.
Ralph Corderoy [Mon, 28 Aug 2017 13:45:16 +0000 (14:45 +0100)]
mhparse: Change mhfixmsg flags from int to bool.
Ralph Corderoy [Mon, 28 Aug 2017 13:35:15 +0000 (14:35 +0100)]
mhparse.h: Add externs for skip_mp_cte_check, etc.
Delete the local copies from the other user.
Ralph Corderoy [Mon, 28 Aug 2017 13:34:44 +0000 (14:34 +0100)]
Delete declaration already available from included header file.
Ralph Corderoy [Mon, 28 Aug 2017 13:25:11 +0000 (14:25 +0100)]
mhparse.h: Add externs for preferred_types[], etc.
Delete the local copies from other users.
Ralph Corderoy [Mon, 28 Aug 2017 13:16:51 +0000 (14:16 +0100)]
Delete declarations already available from included header files.
Ralph Corderoy [Mon, 28 Aug 2017 12:52:48 +0000 (13:52 +0100)]
mhbuildsbr.c: Include mhcachesbr.h. Delete copy of prototype.
Ralph Corderoy [Mon, 28 Aug 2017 12:50:41 +0000 (13:50 +0100)]
mhfixmsg.c: Make mhfixmsgsbr() static.
Ralph Corderoy [Mon, 28 Aug 2017 12:37:24 +0000 (13:37 +0100)]
Move NPARTS and NTYPES from mhparse.h to mhmisc.h.
It's mhmisc.c that has the global arrays that use them.
Ralph Corderoy [Mon, 28 Aug 2017 12:32:38 +0000 (13:32 +0100)]
mhmisc.h: Add mhmisc.c's global variables as externs.
Delete the local copies from other users.
Ralph Corderoy [Mon, 28 Aug 2017 12:25:53 +0000 (13:25 +0100)]
Create mhmisc.h with mhmisc.c's global-function prototypes.
Delete the many local copies from each caller.
Ralph Corderoy [Mon, 28 Aug 2017 12:08:34 +0000 (13:08 +0100)]
Make functions with no external callers by name static.
Ralph Corderoy [Mon, 28 Aug 2017 11:47:38 +0000 (12:47 +0100)]
rcvtty.c: Remove duplicate prototype. Other in mts.h.
Ralph Corderoy [Mon, 28 Aug 2017 11:45:32 +0000 (12:45 +0100)]
aliasbr.c: Remove duplicate prototypes. Others in aliasbr.h.
Ralph Corderoy [Sun, 27 Aug 2017 19:04:42 +0000 (20:04 +0100)]
mhparam: exit(3) zero if all components found, else one.
The exit status used to be a count of the number missing, clipped to
120. That doesn't seem useful, and is overhead to document, read, and
test. Use the normal Unix 0 or 1 instead.
David Levine [Sun, 27 Aug 2017 13:25:21 +0000 (09:25 -0400)]
Ensure that mhfixmsg exit status is either 0 or 1.
Ralph noticed where exit status values were being accumulated, and those
values could include -1.
Ralph Corderoy [Sun, 27 Aug 2017 13:08:22 +0000 (14:08 +0100)]
Add gcc's pure function attribute.
Mark quite a few function prototypes with it.
Ralph Corderoy [Sun, 27 Aug 2017 12:52:46 +0000 (13:52 +0100)]
inc.c: Make maildir_srt() static.
Ralph Corderoy [Sun, 27 Aug 2017 11:13:39 +0000 (12:13 +0100)]
Replace add(foo, NULL) with mh_xstrdup(foo).
add()'s arguments are back to front so add(foo, bar) produces bar+foo in
the normal case. Thus add(foo, NULL) is read as the jarring NULL+foo.
Removing the NULL with mh_xstrdup() avoids this. FENDNULL is used when
it isn't obvious foo can't be NULL as add() treats it as "" in that
case.
Ralph Corderoy [Sun, 27 Aug 2017 10:53:26 +0000 (11:53 +0100)]
Replace strlen("foo") with LEN("foo").
The existing LEN() uses sizeof.
Ralph Corderoy [Sun, 27 Aug 2017 10:47:02 +0000 (11:47 +0100)]
context_find.c: Hoist strlen(3) out of search loop.
Ralph Corderoy [Sun, 27 Aug 2017 10:34:50 +0000 (11:34 +0100)]
Add die(fmt, ...). Equivalent to adios(NULL, fmt, ...).
Avoids the noise of the `NULL' first parameter that's used in over 70%
of adios() calls. Removes the possibility of it being omitted and `fmt'
being used instead. `die' is already in use in nmh's shell scripts.
Had to rename post.c's existing die() to avoid it clashing.
Ralph Corderoy [Sun, 27 Aug 2017 09:49:10 +0000 (10:49 +0100)]
mhparam: Remove `libdir', deprecated in 1.7.
Use existing `libexecdir' instead.
Ralph Corderoy [Sun, 27 Aug 2017 09:39:11 +0000 (10:39 +0100)]
pick: Remove support for MHPDEBUG environment variable.
It was deprecated in 1.7, and the -debug option gives the same
behaviour.
Ralph Corderoy [Sun, 27 Aug 2017 09:16:11 +0000 (10:16 +0100)]
Add MAX_EXIT, value 120, to limit some more exit(3) values.
mhparam(1) altered to use new macro. ap(1) and dp(1) now limit.
Ralph Corderoy [Sat, 26 Aug 2017 21:40:40 +0000 (22:40 +0100)]
mh_xmalloc() et al: Use C99's `%zu' to print size_t.
David Levine [Sat, 26 Aug 2017 20:06:52 +0000 (16:06 -0400)]
Treat %(myhost) failure to match canonical hostname as information.
Not an error from test-myhost.
Ralph Corderoy [Sat, 26 Aug 2017 18:24:05 +0000 (19:24 +0100)]
Replace printf("foo\n") with puts("foo").
Ralph Corderoy [Sat, 26 Aug 2017 18:19:16 +0000 (19:19 +0100)]
Add gcc's nonnull function attribute.
Apply it to some prototypes to get started.
Ralph Corderoy [Sat, 26 Aug 2017 17:41:42 +0000 (18:41 +0100)]
Use C99's variable-argument preprocessor macros for ALLOC_SIZE.
ALLOC_SIZE2() can be deleted.
Ralph Corderoy [Sat, 26 Aug 2017 17:15:21 +0000 (18:15 +0100)]
Add gcc's malloc function attribute.
Mark wrappers for malloc(3), strdup(3), etc.
Ralph Corderoy [Sat, 26 Aug 2017 17:02:59 +0000 (18:02 +0100)]
fmt_rfc2047.c: Tables hexindex[] and index_64[] can be const.
Ralph Corderoy [Sat, 26 Aug 2017 16:36:31 +0000 (17:36 +0100)]
Add gcc's const function attribute.
Ralph Corderoy [Sat, 26 Aug 2017 16:29:08 +0000 (17:29 +0100)]
Add gcc's alloc_size function attribute.
Used for malloc-wrapper, etc.
Ralph Corderoy [Sat, 26 Aug 2017 14:01:35 +0000 (15:01 +0100)]
Add more NORETURN and CHECK_PRINTF function attributes.
And fix the errors that the compiler then detects.
David Levine [Sat, 26 Aug 2017 11:30:30 +0000 (07:30 -0400)]
Changed failure exit status of mkstemp(1) from 255 to 1.
For consistency, on Ralph's suggestion.
Ralph Corderoy [Sat, 26 Aug 2017 10:51:06 +0000 (11:51 +0100)]
forw.man, mh-mime.man: Add missing commas in `SEE ALSO' list.
Inspired by
6db45651 .
Ralph Corderoy [Fri, 25 Aug 2017 21:43:46 +0000 (22:43 +0100)]
picksbr.c: Specify parameters of nexus's n_action function pointer.
Omitting them is obsolescent by modern C standards.
Ralph Corderoy [Fri, 25 Aug 2017 21:36:01 +0000 (22:36 +0100)]
Print pointers in debug with C99's `%p' rather than `0x%x'.
The `%x' needed a double cast, the `%p' needs just a single to void
pointer. The output can differ, e.g. `0x0' v. perhaps
implementation-defined `(nil)'.
Ralph Corderoy [Fri, 25 Aug 2017 21:20:17 +0000 (22:20 +0100)]
picksbr.c: fprintf function pointer with unsigned-long-long cast.
It was previously a double cast, to unsigned long, and then to unsigned
int, and formatted with `0x%x'. Now we're C99, at least, we can use
unsigned long long and `%#llx'. Though the fprintf() in question should
be a BUG() that abort(3)s.
David Levine [Fri, 25 Aug 2017 23:35:55 +0000 (19:35 -0400)]
Fixed extra and missing trailing commas in SEE ALSO sections of man pages.
Ralph Corderoy [Fri, 25 Aug 2017 08:45:00 +0000 (09:45 +0100)]
build_nmh: Stop -d enabling assert(3)s.
c347c3bb enabled asserts by default so alter -d's description to not say
it enables them as this may make users thing that have to disable
optimisation, -d's other action, to get them. Don't add
`--enable-assert' to configure's options.
Ralph Corderoy [Thu, 24 Aug 2017 19:09:00 +0000 (20:09 +0100)]
Format with `%#x' instead of `0x%x' if difference matters not.
Zero formats as `0' rather than `0x0', but that doesn't matter in debug
output, or an error message about a byte's value to the user.
Ralph Corderoy [Thu, 24 Aug 2017 15:03:44 +0000 (16:03 +0100)]
mhlist -verbose: Don't duplicate message/external-body's parameters.
The test of eb_flags remains, and since the old code used to insist
eb_access, `access-type', was set, the new code adds a note if it's
missing.
Ralph Corderoy [Thu, 24 Aug 2017 14:56:06 +0000 (15:56 +0100)]
mhparse.c: Correct comment; si_val is the `anonymous' Boolean.
Ralph Corderoy [Thu, 24 Aug 2017 12:18:01 +0000 (13:18 +0100)]
mhlist -debug: Print FILE pointers with `%p', not `%#x'.
Removes the double casting.
Ralph Corderoy [Wed, 23 Aug 2017 22:38:50 +0000 (23:38 +0100)]
mhbuildsbr.c: Ensure temporary FILE closed regardless of success.
If the fopen() succeeded, but the fwrite() failed, then the FILE wasn't
fclose()'d.
Ralph Corderoy [Wed, 23 Aug 2017 21:50:33 +0000 (22:50 +0100)]
mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else.
Also makes more clear a FILE pointer that's probably not fclose()'d.
Ralph Corderoy [Wed, 23 Aug 2017 21:16:32 +0000 (22:16 +0100)]
Flip logic, moving goto from else- to then-block.
Thus removing the need for the `else'.
Ralph Corderoy [Wed, 23 Aug 2017 21:11:49 +0000 (22:11 +0100)]
Don't need to `else' after done() at end of then-block.
Ralph Corderoy [Wed, 23 Aug 2017 21:04:42 +0000 (22:04 +0100)]
Don't need to `else' after adios() at end of then-block.
Only true of simple if-else rather than a chain.
Ralph Corderoy [Wed, 23 Aug 2017 20:39:59 +0000 (21:39 +0100)]
sh scripts: Remove `else' after exit at end of then-block.
Only for simple if-then-else-fi with no elif.
Ralph Corderoy [Wed, 23 Aug 2017 20:38:55 +0000 (21:38 +0100)]
uip/rcvtty.c: Flip logic, moving `return' to then-block.
There's then no need for an `else' around the old then-block.
Before After
if (foo) if (!foo)
bar(); xyzzy();
else return;
xyzzy(); bar();
return;
Ralph Corderoy [Wed, 23 Aug 2017 20:25:52 +0000 (21:25 +0100)]
Remove the `else' after a simple if-then block ending in `break'.
Before After
if (foo) if (foo)
break; break;
else bar();
bar();
Ralph Corderoy [Wed, 23 Aug 2017 20:20:25 +0000 (21:20 +0100)]
mhlistsbr.c: Replace list_application() with body at call site.
list_application()'s comment said the function didn't need to exist.
It's correct, so delete it. The sole caller now calls list_content(),
as list_application() used to do. That's actually the same as other
cases in the switch so merge them. There is a slight difference:
list_application() used to call list_content() and then return OK
regardless, now it returns list_content()'s value, but that's always OK
too.
Ralph Corderoy [Tue, 22 Aug 2017 23:22:58 +0000 (00:22 +0100)]
mhmail: Turn sh's else-if into elif.
Ralph Corderoy [Tue, 22 Aug 2017 23:17:22 +0000 (00:17 +0100)]
Join the lines of another couple of `else if'.
It's misleading to have them on separate lines, especially when there's
a blank line in between.
Ken Hornstein [Wed, 23 Aug 2017 16:08:24 +0000 (12:08 -0400)]
Make sure we return the descriptor from the file handle. Noted by
Ralph Corderoy.
Ralph Corderoy [Mon, 21 Aug 2017 14:02:51 +0000 (15:02 +0100)]
Reformat else-if that are split over two or more lines into one.
No functional change intended.
Ralph Corderoy [Mon, 21 Aug 2017 13:44:19 +0000 (14:44 +0100)]
Convert some Boolean variables to the bool type.
Ralph Corderoy [Mon, 21 Aug 2017 11:06:40 +0000 (12:06 +0100)]
Convert some Boolean variables to the bool type.
Ralph Corderoy [Mon, 21 Aug 2017 10:09:02 +0000 (11:09 +0100)]
Add ZERO(p) for the typical memset(p, 0, sizeof *p) dance.
Also seen as memset(&foo->bar_xyzzy, 0, sizeof foo->bar_xyzzy). I find
it tedious to keep checking the parameters are in agreement when reading
the code.
David Levine [Mon, 21 Aug 2017 20:44:07 +0000 (16:44 -0400)]
Removed conditional addition of -D_FORTIFY_SOURCE=2 from CPPFLAGS.
And added to CFLAGS in build_nmh.
Ralph Corderoy [Sun, 20 Aug 2017 13:59:26 +0000 (14:59 +0100)]
man: Vet the NAME sections, especially mhfixmsg's.
Don't limit mhfixmsg to fixing "nmh MIME" emails.
Ralph Corderoy [Sun, 20 Aug 2017 13:16:09 +0000 (14:16 +0100)]
cppflags.m4: Don't trample CFLAGS and CPPFLAGS.
They were always being restored, but not necessarily saved first. There
might still be some odd behaviour in this area. I'm seeing -D...
preprocessor symbols disappear on subsequent runs causing compilation
problems, e.g. strcasecmp(3) not prototyped.
David Levine [Sun, 20 Aug 2017 13:20:49 +0000 (09:20 -0400)]
Add -D_FORTIFY_SOURCE=2 to CPPFLAGS instead of AM_CPPFLAGS.
To make it easier for packagers to override.
Fix to commit
35d2b4dc00d705e6816bcb0ccab491aabda688dc .
David Levine [Sun, 20 Aug 2017 12:50:17 +0000 (08:50 -0400)]
Restored old NAME in mhical(1) man page.
mhical only operates on iCalendar event requests, not messages.
Fix to commit
0e7daaa2daf6c668c8c6feb9da3c9a6639fa4e7e .
Ralph Corderoy [Sun, 20 Aug 2017 11:33:38 +0000 (12:33 +0100)]
scan.man: Note that %{body} does not decode MIME.