]> diplodocus.org Git - nmh/log
nmh
8 years agoDEFAULT_PAGER: Move from nmh.h to mh.h. Former is "config.h".
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.

8 years agogeteditor.c: Hard-code the default, "vi".
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.

8 years agoMove base64.c's prototypes from prototypes.h to new base64.h.
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.

8 years agomhbuild.man: Fix grammar indentation by expanding tabs.
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.

8 years agodecodeBase64(): Limit length of error message on invalid input.
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.

8 years agoRestrict use of alloc_size function attribute to gcc >= 4.3.0.
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.

8 years agoMove read_line.c's prototypes from prototypes.h to new read_line.h.
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.

8 years agoAdd ENDNULL macro for gcc's `sentinel' function attribute.
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.

8 years agoMove terminal.c's prototypes from prototypes.h to new terminal.h.
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.

8 years agoFix spelling in comment.
Ralph Corderoy [Mon, 28 Aug 2017 17:13:17 +0000 (18:13 +0100)]
Fix spelling in comment.

8 years agoread_switch_multiword.c: siglongjmp(3) removes need for `else'.
Ralph Corderoy [Mon, 28 Aug 2017 17:09:59 +0000 (18:09 +0100)]
read_switch_multiword.c: siglongjmp(3) removes need for `else'.

8 years agomhlsbr.c: Don't need to `else' after longjmp() at end of then-block.
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.

8 years agoRemove comment asking if siglongjmp(3) should be used; it is.
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).

8 years agoDon't need to `else' after mhladios() at end of then-block.
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.

8 years agoGive mhldone() and mhladios() the NORETURN function attribute.
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.

8 years agoDon't cast zero to pid_t for setpgid(2)'s first argument.
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.

8 years agoDon't cast zero to char for storing at pointer to char.
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.

8 years agoDon't cast zero to a non-function pointer; use NULL instead.
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.

8 years agomhparse: Change mhfixmsg flags from int to bool.
Ralph Corderoy [Mon, 28 Aug 2017 13:45:16 +0000 (14:45 +0100)]
mhparse: Change mhfixmsg flags from int to bool.

8 years agomhparse.h: Add externs for skip_mp_cte_check, etc.
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.

8 years agoDelete declaration already available from included header file.
Ralph Corderoy [Mon, 28 Aug 2017 13:34:44 +0000 (14:34 +0100)]
Delete declaration already available from included header file.

8 years agomhparse.h: Add externs for preferred_types[], etc.
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.

8 years agoDelete declarations already available from included header files.
Ralph Corderoy [Mon, 28 Aug 2017 13:16:51 +0000 (14:16 +0100)]
Delete declarations already available from included header files.

8 years agomhbuildsbr.c: Include mhcachesbr.h. Delete copy of prototype.
Ralph Corderoy [Mon, 28 Aug 2017 12:52:48 +0000 (13:52 +0100)]
mhbuildsbr.c: Include mhcachesbr.h.  Delete copy of prototype.

8 years agomhfixmsg.c: Make mhfixmsgsbr() static.
Ralph Corderoy [Mon, 28 Aug 2017 12:50:41 +0000 (13:50 +0100)]
mhfixmsg.c: Make mhfixmsgsbr() static.

8 years agoMove NPARTS and NTYPES from mhparse.h to mhmisc.h.
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.

8 years agomhmisc.h: Add mhmisc.c's global variables as externs.
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.

8 years agoCreate mhmisc.h with mhmisc.c's global-function prototypes.
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.

8 years agoMake functions with no external callers by name static.
Ralph Corderoy [Mon, 28 Aug 2017 12:08:34 +0000 (13:08 +0100)]
Make functions with no external callers by name static.

8 years agorcvtty.c: Remove duplicate prototype. Other in mts.h.
Ralph Corderoy [Mon, 28 Aug 2017 11:47:38 +0000 (12:47 +0100)]
rcvtty.c: Remove duplicate prototype.  Other in mts.h.

8 years agoaliasbr.c: Remove duplicate prototypes. Others in aliasbr.h.
Ralph Corderoy [Mon, 28 Aug 2017 11:45:32 +0000 (12:45 +0100)]
aliasbr.c: Remove duplicate prototypes.  Others in aliasbr.h.

8 years agomhparam: exit(3) zero if all components found, else one.
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.

8 years agoEnsure that mhfixmsg exit status is either 0 or 1.
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.

8 years agoAdd gcc's pure function attribute.
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.

8 years agoinc.c: Make maildir_srt() static.
Ralph Corderoy [Sun, 27 Aug 2017 12:52:46 +0000 (13:52 +0100)]
inc.c: Make maildir_srt() static.

8 years agoReplace add(foo, NULL) with mh_xstrdup(foo).
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.

8 years agoReplace strlen("foo") with LEN("foo").
Ralph Corderoy [Sun, 27 Aug 2017 10:53:26 +0000 (11:53 +0100)]
Replace strlen("foo") with LEN("foo").

The existing LEN() uses sizeof.

8 years agocontext_find.c: Hoist strlen(3) out of search loop.
Ralph Corderoy [Sun, 27 Aug 2017 10:47:02 +0000 (11:47 +0100)]
context_find.c: Hoist strlen(3) out of search loop.

8 years agoAdd die(fmt, ...). Equivalent to adios(NULL, fmt, ...).
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.

8 years agomhparam: Remove `libdir', deprecated in 1.7.
Ralph Corderoy [Sun, 27 Aug 2017 09:49:10 +0000 (10:49 +0100)]
mhparam: Remove `libdir', deprecated in 1.7.

Use existing `libexecdir' instead.

8 years agopick: Remove support for MHPDEBUG environment variable.
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.

8 years agoAdd MAX_EXIT, value 120, to limit some more exit(3) values.
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.

8 years agomh_xmalloc() et al: Use C99's `%zu' to print size_t.
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.

8 years agoTreat %(myhost) failure to match canonical hostname as information.
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.

8 years agoReplace printf("foo\n") with puts("foo").
Ralph Corderoy [Sat, 26 Aug 2017 18:24:05 +0000 (19:24 +0100)]
Replace printf("foo\n") with puts("foo").

8 years agoAdd gcc's nonnull function attribute.
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.

8 years agoUse C99's variable-argument preprocessor macros for ALLOC_SIZE.
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.

8 years agoAdd gcc's malloc function attribute.
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.

8 years agofmt_rfc2047.c: Tables hexindex[] and index_64[] can be const.
Ralph Corderoy [Sat, 26 Aug 2017 17:02:59 +0000 (18:02 +0100)]
fmt_rfc2047.c: Tables hexindex[] and index_64[] can be const.

8 years agoAdd gcc's const function attribute.
Ralph Corderoy [Sat, 26 Aug 2017 16:36:31 +0000 (17:36 +0100)]
Add gcc's const function attribute.

8 years agoAdd gcc's alloc_size 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.

8 years agoAdd more NORETURN and CHECK_PRINTF function attributes.
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.

8 years agoChanged failure exit status of mkstemp(1) from 255 to 1.
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.

8 years agoforw.man, mh-mime.man: Add missing commas in `SEE ALSO' list.
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.

8 years agopicksbr.c: Specify parameters of nexus's n_action function pointer.
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.

8 years agoPrint pointers in debug with C99's `%p' rather than `0x%x'.
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)'.

8 years agopicksbr.c: fprintf function pointer with unsigned-long-long cast.
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.

8 years agoFixed extra and missing trailing commas in SEE ALSO sections of man pages.
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.

8 years agobuild_nmh: Stop -d enabling assert(3)s.
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.

8 years agoFormat with `%#x' instead of `0x%x' if difference matters not.
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.

8 years agomhlist -verbose: Don't duplicate message/external-body's parameters.
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.

8 years agomhparse.c: Correct comment; si_val is the `anonymous' Boolean.
Ralph Corderoy [Thu, 24 Aug 2017 14:56:06 +0000 (15:56 +0100)]
mhparse.c: Correct comment; si_val is the `anonymous' Boolean.

8 years agomhlist -debug: Print FILE pointers with `%p', not `%#x'.
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.

8 years agomhbuildsbr.c: Ensure temporary FILE closed regardless of success.
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.

8 years agomhbuildsbr.c: Flip logic, moving goto to then-block; no need for else.
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.

8 years agoFlip logic, moving goto from else- to then-block.
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'.

8 years agoDon't need to `else' after done() at end of then-block.
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.

8 years agoDon't need to `else' after adios() 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.

8 years agosh scripts: Remove `else' after exit at end of then-block.
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.

8 years agouip/rcvtty.c: Flip logic, moving `return' to then-block.
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;

8 years agoRemove the `else' after a simple if-then block ending in `break'.
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();

8 years agomhlistsbr.c: Replace list_application() with body at call site.
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.

8 years agomhmail: Turn sh's else-if into elif.
Ralph Corderoy [Tue, 22 Aug 2017 23:22:58 +0000 (00:22 +0100)]
mhmail: Turn sh's else-if into elif.

8 years agoJoin the lines of another couple of `else if'.
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.

8 years agoMake sure we return the descriptor from the file handle. Noted by
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.

8 years agoReformat else-if that are split over two or more lines into one.
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.

8 years agoConvert some Boolean variables to the bool type.
Ralph Corderoy [Mon, 21 Aug 2017 13:44:19 +0000 (14:44 +0100)]
Convert some Boolean variables to the bool type.

8 years agoConvert 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.

8 years agoAdd ZERO(p) for the typical memset(p, 0, sizeof *p) dance.
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.

8 years agoRemoved conditional addition of -D_FORTIFY_SOURCE=2 from CPPFLAGS.
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.

8 years agoman: Vet the NAME sections, especially mhfixmsg's.
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.

8 years agocppflags.m4: Don't trample CFLAGS and CPPFLAGS.
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.

8 years agoAdd -D_FORTIFY_SOURCE=2 to CPPFLAGS instead of AM_CPPFLAGS.
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.

8 years agoRestored old NAME in mhical(1) man page.
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.

8 years agoscan.man: Note that %{body} does not decode MIME.
Ralph Corderoy [Sun, 20 Aug 2017 11:33:38 +0000 (12:33 +0100)]
scan.man: Note that %{body} does not decode MIME.

8 years agosbr/mf.c: Simplify logic, ditching endless for-loops and switch.
Ralph Corderoy [Sun, 20 Aug 2017 11:20:45 +0000 (12:20 +0100)]
sbr/mf.c: Simplify logic, ditching endless for-loops and switch.

Some of the control flow follows the pattern of the larger sections: an
endless for-loop with a switch, and then cases that continue or break,
and another break out of the for loop.  For the simpler cases, it's much
easier to read a simple while-loop that achieves the same in fewer
lines.  No functional change intended.

8 years agosbr/mf.c: Remove QUOTE macro, use its '\\' definition instead.
Ralph Corderoy [Sun, 20 Aug 2017 10:56:55 +0000 (11:56 +0100)]
sbr/mf.c: Remove QUOTE macro, use its '\\' definition instead.

The name suggests a quote character, not the backslash as an escape
character that quotes what comes after it.  It's easier to read '\\' and
instantly know what's meant.

8 years agocontains8bit(): Don't fetch a byte when start >= end.
Ralph Corderoy [Sun, 20 Aug 2017 10:38:04 +0000 (11:38 +0100)]
contains8bit(): Don't fetch a byte when start >= end.

The test for a NUL byte was before the test for start being before end.
Whilst here, hoist the test of end out of the per-byte loop, alter the
function to return bool, and merge the two, different, comments
explaining the function's behaviour.

8 years agoNEWS: Add bug fix: EPIPE when writing error no longer recurses.
Ralph Corderoy [Sun, 20 Aug 2017 09:34:01 +0000 (10:34 +0100)]
NEWS: Add bug fix: EPIPE when writing error no longer recurses.

Also move an existing item into the Bug Fixes section.

8 years agoNEWS: Consistent punctuation. Mention SI and IEC quantities.
Ralph Corderoy [Sun, 20 Aug 2017 08:31:18 +0000 (09:31 +0100)]
NEWS: Consistent punctuation.  Mention SI and IEC quantities.

8 years agotest-sendfiles: Feed `lzma -cd' stdin rather than a filename.
Ralph Corderoy [Sat, 19 Aug 2017 14:58:49 +0000 (15:58 +0100)]
test-sendfiles: Feed `lzma -cd' stdin rather than a filename.

HÃ¥kon Alstadheim reported that Debian's lzma-9.22-2 would complain at
`lzma -cd foo.tar' with `unknown suffix -- unchanged' even though it was
not being asked to alter the file, or produce a new one based on its
filename.  This appears to be https://bugs.debian.org/700681.  The lzma
from Arch Linux's xz 5.2.3-1 does no have this fault.  Work around it by
feeding the file to decompress on standard input for all the compression
programs being tested;  none of the others should mind.

8 years agoProtect fileno() call against NULL argument.
David Levine [Sat, 19 Aug 2017 03:18:15 +0000 (23:18 -0400)]
Protect fileno() call against NULL argument.

Fix to commit 337b4e616e8f53ba06285b1645e1df9918ed5c16.  Thanks to
Norm for reporting and Ken for diagnosing the bug.

8 years agolock_file.c: Compiler warns of unused isnewlock if HAVE_LIBLOCKFILE.
Ralph Corderoy [Fri, 18 Aug 2017 13:29:59 +0000 (14:29 +0100)]
lock_file.c: Compiler warns of unused isnewlock if HAVE_LIBLOCKFILE.

8 years agoDefault CFLAGS to -std=c99 instead of -ansi.
David Levine [Thu, 17 Aug 2017 23:45:20 +0000 (19:45 -0400)]
Default CFLAGS to -std=c99 instead of -ansi.

gcc -ansi -pedantic issued a few warnings about C90 not supporting the
"ll" printf length modifier.  Ralph pointed out that
http://www.unix.org/version4/overview.html says:

    The following source code portability standards lie at the core of
    the Single UNIX Specification:

        POSIX.1-2008

    (This is technically identical to the Base Specifications, Issue 7;
    they are one and the same document.)

        The ISO/IEC 9899:1999 standard

So perhaps we're wrong to expect modern POSIX code to compile as C90.

8 years agomhical expected an ics file as input and after just pressing
Leonardo Taccari [Thu, 17 Aug 2017 23:42:48 +0000 (19:42 -0400)]
mhical expected an ics file as input and after just pressing
^D I've found that mhical wasn't happy about an empty input.
A trivial patch that should fix this issue.

8 years agoBoth f_typestr(): Remove parenthesis from long list of returns.
Ralph Corderoy [Thu, 17 Aug 2017 11:42:57 +0000 (12:42 +0100)]
Both f_typestr(): Remove parenthesis from long list of returns.

It's not a function call, they're just noise.

8 years agoBoth f_typestr(): Rebuild switch from FT_* to string from scratch.
Ralph Corderoy [Thu, 17 Aug 2017 11:36:50 +0000 (12:36 +0100)]
Both f_typestr(): Rebuild switch from FT_* to string from scratch.

Adds missing cases, e.g. FT_LS_CFIND.  Removes inconsistent "FT_" prefix
from some strings, e.g. FT_LS_DECODE.  Re-orders cases to match
definitions.

8 years agofmtdump.c, fmttest.c: Remove tests for FT_LIT_FORCE.
Ralph Corderoy [Thu, 17 Aug 2017 11:20:16 +0000 (12:20 +0100)]
fmtdump.c, fmttest.c: Remove tests for FT_LIT_FORCE.

It isn't defined, and git-grep(1) suggests it was a local Lawrence
Berkeley Laboratory modification that output a literal without consuming
any of the width budget.

8 years agoMakefile.am: Remove `test -d' guarding `mkdir -p'.
Ralph Corderoy [Thu, 17 Aug 2017 11:09:43 +0000 (12:09 +0100)]
Makefile.am: Remove `test -d' guarding `mkdir -p'.

8 years agoMakefile.am: Remove multiple `mkdir -p' for etc; use ./configure.
Ralph Corderoy [Thu, 17 Aug 2017 10:59:38 +0000 (11:59 +0100)]
Makefile.am: Remove multiple `mkdir -p' for etc;  use ./configure.

A `mkdir -p' was used in each rule that created a file in etc to ensure
the directory already existed.  Ken pointed out existing ./configure
code to do that for the man directory, just once.  Use that for etc too.
Remove the `test -d' because `mkdir -p' does that itself.