]> diplodocus.org Git - nmh/log
nmh
8 years agoDocument bug fix
Ken Hornstein [Tue, 1 Aug 2017 17:28:04 +0000 (13:28 -0400)]
Document bug fix

8 years agoMerge branch 'fix-post-bcc'
Ken Hornstein [Tue, 1 Aug 2017 17:22:36 +0000 (13:22 -0400)]
Merge branch 'fix-post-bcc'

This branch fixes bug #51098; the lack of alias expansion on a From line
when doing a Bcc.  Admittedly, this is rather an obscure bug, and AFAICT
it never worked in any version of MH or nmh, but it is fixed now.

8 years agoImplemented test for this patch.
Ken Hornstein [Tue, 1 Aug 2017 17:21:21 +0000 (13:21 -0400)]
Implemented test for this patch.

This patch tests the code that does alias expansion in a From line when
doing bcc.  Which is, now that I think about it, one heck of a corner case.

8 years agoMove m_getfld's MS_* mbox-type macros to the only user.
Ralph Corderoy [Tue, 1 Aug 2017 13:41:20 +0000 (14:41 +0100)]
Move m_getfld's MS_* mbox-type macros to the only user.

8 years agoRestricted application of the adjustment in m_Eom().
David Levine [Tue, 1 Aug 2017 02:00:39 +0000 (22:00 -0400)]
Restricted application of the adjustment in m_Eom().

Per Ralph's suggestion.  Update to commit 29db9a64a.  Also,
consolidated print statments in test-eom-align.

8 years agoHacked m_Eom() to fix test-eom-align.
David Levine [Mon, 31 Jul 2017 00:24:34 +0000 (20:24 -0400)]
Hacked m_Eom() to fix test-eom-align.

8 years agoRestored local variable to m_Eom(), to not truncate EOF.
David Levine [Sat, 29 Jul 2017 21:55:25 +0000 (17:55 -0400)]
Restored local variable to m_Eom(), to not truncate EOF.

Reversion of significant part of commit d3e11c5e9.  Thanks to Ralph
for noticing that it wasn't a good change.

8 years agoRemoved a local variable from m_Eom().
David Levine [Sat, 29 Jul 2017 21:07:06 +0000 (17:07 -0400)]
Removed a local variable from m_Eom().

Minor code simplification in preparation for upcoming fix.

8 years agoSimplified m_strn() per Ralph's suggestions.
David Levine [Sat, 29 Jul 2017 16:42:35 +0000 (12:42 -0400)]
Simplified m_strn() per Ralph's suggestions.

Update to commit 4a56a28ac.

8 years agoUse m_strn() to allow restoration of buffer size to 26 bytes.
David Levine [Sat, 29 Jul 2017 14:47:16 +0000 (10:47 -0400)]
Use m_strn() to allow restoration of buffer size to 26 bytes.

Fix to commit a3724ed39.

8 years agodtimezone(): Explain abs(3) is undefined on INT_MIN.
Ralph Corderoy [Sat, 29 Jul 2017 14:06:11 +0000 (15:06 +0100)]
dtimezone(): Explain abs(3) is undefined on INT_MIN.

That's why a negative int is flipped over into unsigned by assuming
two's complement.

8 years agoAdded m_str() and m_strn() functions to convert int to string.
David Levine [Sat, 29 Jul 2017 14:02:28 +0000 (10:02 -0400)]
Added m_str() and m_strn() functions to convert int to string.

Allows better fix to uip/forw.c than commit d711510305.

8 years agoSimplify dtimezone()'s logic by working with unsigned int.
Ralph Corderoy [Sat, 29 Jul 2017 13:29:15 +0000 (14:29 +0100)]
Simplify dtimezone()'s logic by working with unsigned int.

Character buffer is resized down from arbitrary 64 to suit 32-bit int,
a change to the recent a3724ed3.

8 years agoFinished implementation, but tests need to be written.
Ken Hornstein [Tue, 25 Jul 2017 19:40:28 +0000 (15:40 -0400)]
Finished implementation, but tests need to be written.

8 years agoAdded some specific tests to test-eom-align.
David Levine [Sun, 23 Jul 2017 15:39:24 +0000 (11:39 -0400)]
Added some specific tests to test-eom-align.

These were found by scanning a much larger range of buffer sizes,
over nmh versions from cvs, 1.4, 1.5, 1.6, and current HEAD.

8 years agoBump up size of two static char[] so gcc knows they won't overflow.
Ralph Corderoy [Mon, 17 Jul 2017 11:58:38 +0000 (12:58 +0100)]
Bump up size of two static char[] so gcc knows they won't overflow.

8 years agoIncrease size of buffer to avoid warning from gcc -Wformat-truncation.
David Levine [Mon, 17 Jul 2017 00:06:01 +0000 (20:06 -0400)]
Increase size of buffer to avoid warning from gcc -Wformat-truncation.

8 years agoReplaced snprintf() to convert an int with m_name().
David Levine [Sun, 16 Jul 2017 21:25:51 +0000 (17:25 -0400)]
Replaced snprintf() to convert an int with m_name().

At Ralph's suggestion.  The goal was to get rid of a warning from
gcc -Wformat-truncation, but the code ends up being cleaner as well.

8 years agoEnhanced mhical syntax error message to provide some context.
David Levine [Sun, 16 Jul 2017 13:02:08 +0000 (09:02 -0400)]
Enhanced mhical syntax error message to provide some context.

Specifically for the case of improperly folded lines.

8 years agoFixed flex fixups to not break LFLAGS.
David Levine [Sat, 15 Jul 2017 13:37:26 +0000 (09:37 -0400)]
Fixed flex fixups to not break LFLAGS.

Addresses comment added in commit 4ac978448.

8 years agoAdded flex fixup for Fedora 26's flex 2.6.1.
David Levine [Sat, 15 Jul 2017 13:16:47 +0000 (09:16 -0400)]
Added flex fixup for Fedora 26's flex 2.6.1.

The fix is compatible with unpatched flex 2.6.1.

8 years agoStart of work to fix lack of address rewriting for bcc
Ken Hornstein [Fri, 23 Jun 2017 15:53:28 +0000 (11:53 -0400)]
Start of work to fix lack of address rewriting for bcc

This is the start of work to fix the problems described in #51098.  Is
not finished yet.

8 years agoRearranged statements to eliminate memory allocation.
David Levine [Sat, 17 Jun 2017 17:42:59 +0000 (13:42 -0400)]
Rearranged statements to eliminate memory allocation.

Update to commit a5bf16c0928cb4044b082f9cf6f44f9bb3998824.

8 years agoShow display program name and arguments in error message if it fails.
David Levine [Sat, 17 Jun 2017 15:01:32 +0000 (11:01 -0400)]
Show display program name and arguments in error message if it fails.

8 years agoDon't bypass scan_content() when expanding pseudoheaders.
David Levine [Sat, 17 Jun 2017 13:32:00 +0000 (09:32 -0400)]
Don't bypass scan_content() when expanding pseudoheaders.

expand_pseudoheader() would avoid the call to scan_content() in order
to inhibit use of quoted-printable for text content.  Removed that;
the user still has control over the use of quoted-printable via
-maxunencoded.  Though now, lines over 998 bytes long will always
be encoded.

8 years agosbr/netsec.c: Report popped TLS error code, don't pop again.
Ralph Corderoy [Sat, 10 Jun 2017 17:32:08 +0000 (18:32 +0100)]
sbr/netsec.c: Report popped TLS error code, don't pop again.

ERR_get_error() pops an error code so having tested that value it should
also be the one that's reported in an error message, not another popped
error code by calling ERR_get_error() again as this misleads as to the
error's cause.

8 years agouip/inc.c: Don't increment variable of type bool.
Ralph Corderoy [Tue, 30 May 2017 22:00:10 +0000 (23:00 +0100)]
uip/inc.c: Don't increment variable of type bool.

gcc 7.1.1 is warning against incrementing `bool' variables.
Assign true instead.

8 years agoFixed double fclose().
David Levine [Thu, 1 Jun 2017 23:54:21 +0000 (19:54 -0400)]
Fixed double fclose().

8 years agoRemove ancient SENDMAILBUG code.
Ken Hornstein [Thu, 1 Jun 2017 16:26:23 +0000 (12:26 -0400)]
Remove ancient SENDMAILBUG code.

Old SMTP code used to treat a code 451 the same as code 250 (success).  It's
not clear if this was ever a real bug in sendmail, but regardless this code
is long obsolete.

8 years agoComment cleanup; removed ancient reference to 4.2BSD systems.
Ken Hornstein [Thu, 1 Jun 2017 16:25:15 +0000 (12:25 -0400)]
Comment cleanup; removed ancient reference to 4.2BSD systems.

8 years agoNormalize connection shutdown handling.
Ken Hornstein [Wed, 31 May 2017 18:39:48 +0000 (14:39 -0400)]
Normalize connection shutdown handling.

I originally tried to make things work so that the netsec client code gave
the client the option of closing the file descriptors if it wanted to, but
I was running into a problem where if TLS negotiation failed part of the
negotiation would be interpreted as connection data.  The code has been
changed to have the sockets close when the SSL BIO is released and to
have netsec_shutdown unconditionally close the file descriptors.

8 years agoUse original error code from OpenSSL.
Ken Hornstein [Wed, 31 May 2017 15:53:47 +0000 (11:53 -0400)]
Use original error code from OpenSSL.

Reuse the error code we already retrieved from OpenSSL, otherwise the
error might be cleared the next time we call ERR_get_error().

8 years agosbr/brkstring.c: Use strchr(3) in brkany(), not own loop.
Ralph Corderoy [Mon, 29 May 2017 12:20:00 +0000 (13:20 +0100)]
sbr/brkstring.c: Use strchr(3) in brkany(), not own loop.

8 years agosizeof char is always 1, so don't bother to divide by it.
Ralph Corderoy [Mon, 29 May 2017 11:56:10 +0000 (12:56 +0100)]
sizeof char is always 1, so don't bother to divide by it.

8 years agoUse DIM(a) macro a few more times; array's dimension using sizeof.
Ralph Corderoy [Mon, 29 May 2017 11:53:24 +0000 (12:53 +0100)]
Use DIM(a) macro a few more times;  array's dimension using sizeof.

8 years agouip/scansbr.c: Add PUTC() macro, similar to FPUTS().
Ralph Corderoy [Mon, 29 May 2017 11:23:38 +0000 (12:23 +0100)]
uip/scansbr.c: Add PUTC() macro, similar to FPUTS().

FPUTS() exists, but all the putc(3) checks for error were written
alongside in longhand.  May as well have a PUTC() to match, though
perhaps just the existing check of the FILE's sticky error state with
ferror(3) is sufficient and neither macro is required.

8 years agouip/scansbr.c: Stop `scan -file' copying mailbox to /dev/null.
Ralph Corderoy [Mon, 29 May 2017 10:49:29 +0000 (11:49 +0100)]
uip/scansbr.c: Stop `scan -file' copying mailbox to /dev/null.

scan() was copying the mailbox to /dev/null when called for `scan -file
foo.mbox' because it used outnum being non-zero as the test of whether
to write instead of FILE pointer scnout being non-NULL.  By switching,
we can avoid the opening of /dev/null that was just to give scnout a
valid value for the needless fputs(3), etc.

Add comment explaining scan()'s outnum input parameter's three
functions: -1, 0, and positive.

8 years agoh/mts.h: Replace char pointer mmdlm1 with macro MMDF_DELIM.
Ralph Corderoy [Sun, 28 May 2017 12:07:25 +0000 (13:07 +0100)]
h/mts.h: Replace char pointer mmdlm1 with macro MMDF_DELIM.

mmdlm1 only ever pointed to its initial string constant.

8 years agosbr/mts.c: Delete mmdlm2; use same-valued mmdlm1 instead.
Ralph Corderoy [Sun, 28 May 2017 11:32:28 +0000 (12:32 +0100)]
sbr/mts.c: Delete mmdlm2;  use same-valued mmdlm1 instead.

mmdlm1 and mmdlm2 had the same compile-time value.  Both could be
changed at run-time by mts.conf(5), but d205d39a stopped that.  Use
mmdlm1 instead of mmdlm2 and delete mmdlm2.

8 years agosbr/mts.c: Make MMDF's delimeters fixed at compile time.
Ralph Corderoy [Sun, 28 May 2017 11:21:12 +0000 (12:21 +0100)]
sbr/mts.c: Make MMDF's delimeters fixed at compile time.

mts.conf(5) allowed `mmdelim1' and `mmdelim2' to alter the default MMDF
begin and end markers of four ASCII SOHs and an LF.  There doesn't seem
to be a modern use for this, and nmh wouldn't have handled longer
markers correctly so remove the capability.

8 years agouip/forw.c, uip/repl.c: Remove -file's "msh" comment.
Ralph Corderoy [Sat, 27 May 2017 16:04:48 +0000 (17:04 +0100)]
uip/forw.c, uip/repl.c: Remove -file's "msh" comment.

The comment claims -file is "interface from msh", but msh(1) was removed
in e6917522.  The options remain as discussion on the list prompted
David to say he uses them occasionally.

8 years agouip/mhparse.c: Fix body starting a byte too soon when no blank line.
Ralph Corderoy [Fri, 26 May 2017 22:34:10 +0000 (23:34 +0100)]
uip/mhparse.c: Fix body starting a byte too soon when no blank line.

m_getfld() returns BODY when the headers run into a line without a colon
instead of being separated from the body by a blank line.  The file's
position and the returned `bufsz' differ from the normal case of a blank
line and then the start of the body, causing confusion.  get_content()
was aware of the difference, documented it, and attempted to correct for
it, but got it wrong and included the `\n' that terminates the last real
header at the start of the "body".  This affected a struct Content's
c_begin.

Use the correct file position for c_begin, adding a comment that
explains the theory for both cases.  Add a test-mhlist case that checks
mhlist(1) states the body size is the same whether it is separated from
the headers by a blank line or not.  Correct existing
test/bad-input/test-header test that expected the extra blank line to be
counted and to appear in the output.

8 years agoRemove mention of msh in comments and to-do list.
Ralph Corderoy [Fri, 26 May 2017 11:36:32 +0000 (12:36 +0100)]
Remove mention of msh in comments and to-do list.

msh(1) was removed in e6917522.

8 years agoMakefile.am: Add test/inc/test-eom-align to XFAIL_TESTS.
Ralph Corderoy [Fri, 26 May 2017 10:56:37 +0000 (11:56 +0100)]
Makefile.am: Add test/inc/test-eom-align to XFAIL_TESTS.

Since 5f34de43, it's expected the test will fail.
Add it to XFAIL_TESTS so it's still run, but its failure doesn't cause
the `check' target to fail.

8 years agoDon't cast lseek(2)'s offset to off_t when it's 0.
Ralph Corderoy [Thu, 25 May 2017 17:12:55 +0000 (18:12 +0100)]
Don't cast lseek(2)'s offset to off_t when it's 0.

`lseek(fd, (off_t)0, SEEK_SET)' does not need the cast when a prototype
is in scope, and <unistd.h> is #include'd.

8 years agouip/slocal.c: Tidy `verbose' logic in usr_file().
Ralph Corderoy [Thu, 25 May 2017 16:23:10 +0000 (17:23 +0100)]
uip/slocal.c: Tidy `verbose' logic in usr_file().

Boolean was being tested three times instead of once after recent
dead-code deletions.

8 years agouip/popsbr.c: Delete unused pop_list(), etc.
Ralph Corderoy [Thu, 25 May 2017 15:29:33 +0000 (16:29 +0100)]
uip/popsbr.c: Delete unused pop_list(), etc.

Those deleted: pop_list(), pop_noop(), pop_rset(), and pop_top().

8 years agosbr/utils.c: Delete dead-code open_form(); not called.
Ralph Corderoy [Thu, 25 May 2017 15:23:00 +0000 (16:23 +0100)]
sbr/utils.c: Delete dead-code open_form();  not called.

8 years agouip/comp.c: Delete single-use NULLMP macro.
Ralph Corderoy [Thu, 25 May 2017 13:36:59 +0000 (14:36 +0100)]
uip/comp.c: Delete single-use NULLMP macro.

It just cast 0 to a pointer to struct msgs and was used once, as a
function's parameter.  Replace that with NULL since a prototype for the
function is visible.

8 years agosbr/fmt_compile.c: Delete single-use NEWFMT macro.
Ralph Corderoy [Thu, 25 May 2017 13:36:33 +0000 (14:36 +0100)]
sbr/fmt_compile.c: Delete single-use NEWFMT macro.

Its simple content was to increment a variable;  doing that in situ is
more clear.

8 years agoRemove support for ./.foo.map index for ./foo mailbox.
Ralph Corderoy [Thu, 25 May 2017 12:53:27 +0000 (13:53 +0100)]
Remove support for ./.foo.map index for ./foo mailbox.

An MH-only index of a mailbox, mbox or MMDF format, called a map file,
could be built and maintained by packf(1), rcvpack(1), and slocal(1),
but since msh(1) was removed in e6917522, there hasn't been a user of
the index file so stop producing it and delete all the supporting code
in uip/dropsbr.c.

mbx_copy() loses its `mapping' and `noisy' parameters;  noisy was only
used when mapping.  Delete mbx_read() and mbx_size() as they have no
callers without maps.

8 years agotest/runpty.c: Add more detail to "timed out" message.
Ralph Corderoy [Thu, 25 May 2017 12:03:53 +0000 (13:03 +0100)]
test/runpty.c: Add more detail to "timed out" message.

test/install-mh/test-version-check was skipped due to timeout, but it
took a lot less than the thirty-second timeout to run.  Add start time
and the time now to the diagnostic, and select(2)'s return value.

8 years agouip/prompter.c: Make getln() static; only called locally.
Ralph Corderoy [Thu, 25 May 2017 10:24:54 +0000 (11:24 +0100)]
uip/prompter.c: Make getln() static;  only called locally.

8 years agouip/prompter.c: Delete obfuscating ERASE, etc., macros.
Ralph Corderoy [Thu, 25 May 2017 10:21:40 +0000 (11:21 +0100)]
uip/prompter.c: Delete obfuscating ERASE, etc., macros.

Their few uses are clearer as `t_io.c_cc[VERASE]' as otherwise the
storage, t_io, isn't mentioned, and c_cc and VERASE match termios.h's
man page.

8 years agouip/prompter.c: Delete unused macros CKILL and CERASE.
Ralph Corderoy [Thu, 25 May 2017 10:18:11 +0000 (11:18 +0100)]
uip/prompter.c: Delete unused macros CKILL and CERASE.

They haven't been used in git's history.  Their definitions of `@' and
`#' might surprise younger users if put into use.  :-)

8 years agouip/inc.c: Delete POP3's -pack option for msh users.
Ralph Corderoy [Wed, 24 May 2017 18:22:02 +0000 (19:22 +0100)]
uip/inc.c: Delete POP3's -pack option for msh users.

inc(1)'s -pack option, only available with POP3 access, stored the
emails in a spool file instead of a folder.  The man page says this was
intended for msh(1) users, but msh was deleted in e6917522.  The spool
file was always in packf(1)'s MMDF format, no option of -mbox, and was a
rare producer of `map' files that indexed the spool file, again intended
for msh.  Removing -pack makes deletion of map files elsewhere in the
code easier.

8 years agouip/dropsbr.c: Delete unused mbx_write() and map_read().
Ralph Corderoy [Wed, 24 May 2017 12:50:25 +0000 (13:50 +0100)]
uip/dropsbr.c: Delete unused mbx_write() and map_read().

Most recently used by msh(1), removed by e6917522.

8 years agoReplace some "FALLTHRU" comments with control flow.
Ralph Corderoy [Tue, 23 May 2017 11:56:00 +0000 (12:56 +0100)]
Replace some "FALLTHRU" comments with control flow.

Instead of a case statement falling through, with a "FALLTHRU" comment,
to the follow case that just does a break, continue, goto, etc.,
control-flow statement, duplicate the statement in place of the comment.
Fall-through should be the exception, and saving a break statement
doesn't offset the cognitive cost when reading the source.

8 years agoconfig/config.c: Fix indentation of "FALLTHRU" comment.
Ralph Corderoy [Tue, 23 May 2017 11:53:32 +0000 (12:53 +0100)]
config/config.c: Fix indentation of "FALLTHRU" comment.

It's not part of the preceding if-statement, but unconditional.

8 years agosbr/m_getfld.c: Fix and improve `delim' comment.
Ralph Corderoy [Sun, 21 May 2017 11:45:54 +0000 (12:45 +0100)]
sbr/m_getfld.c: Fix and improve `delim' comment.

fdelimlen is one higher than was described in 86c5ebc87.
Describe pointer positions pictorially.

8 years agoFixed a couple of typos.
David Levine [Tue, 23 May 2017 00:17:48 +0000 (20:17 -0400)]
Fixed a couple of typos.

8 years agotest/inc/test-eom-align: Show size of test email as progress.
Ralph Corderoy [Sat, 20 May 2017 11:46:04 +0000 (12:46 +0100)]
test/inc/test-eom-align: Show size of test email as progress.

Don't bother over-printing;  Perhaps when it's working again and lots of
output is being produced.

8 years agotest/inc/test-eom-align: Fix tests; they've never worked.
Ralph Corderoy [Sat, 20 May 2017 11:38:22 +0000 (12:38 +0100)]
test/inc/test-eom-align: Fix tests; they've never worked.

Instead of cycling through lots of mbox sizes, $STDIO_BUFSZ was always
used as the desired size resulting in tests A and B being duplicated 221
times each.  Slowly, if using valgrind.  The tests fail now they're
fixed.

8 years agotest/common.sh.in: test_skip(): Remove unused variable.
Ralph Corderoy [Sat, 20 May 2017 11:09:13 +0000 (12:09 +0100)]
test/common.sh.in: test_skip(): Remove unused variable.

`$Test' was being interpolated into the output, but has never existed.
Rephrase the output given a /^SKIP: / line follows from the test harness
due to the `exit 77'.

8 years agotest/runpty.c: Add missing exit(3) after child fails to execvp(3).
Ralph Corderoy [Sat, 20 May 2017 10:53:55 +0000 (11:53 +0100)]
test/runpty.c: Add missing exit(3) after child fails to execvp(3).

8 years agouip/aliasbr.c: Remove dead code used for Unix groups.
Ralph Corderoy [Sat, 20 May 2017 10:48:10 +0000 (11:48 +0100)]
uip/aliasbr.c: Remove dead code used for Unix groups.

Main functionality removed in afaab789.

8 years agoRemove support for aliases based on Unix groups.
Ken Hornstein [Thu, 18 May 2017 18:03:09 +0000 (14:03 -0400)]
Remove support for aliases based on Unix groups.

Remove support for expanding aliases based on group membership (=) and
all users who have a particular primary group (+).  This was the result
of a discussion on nmh-workers; these features were of dubious value, likely
not used, and interfered with RFC-2047 encoded names in alias files.

8 years agouip/mhshowsbr.c: Increase buffer size for showing-content command.
Ralph Corderoy [Wed, 17 May 2017 16:56:00 +0000 (17:56 +0100)]
uip/mhshowsbr.c: Increase buffer size for showing-content command.

Experimenting with small BUFSIZ to try and trigger programs caused one
test to fail because the code detected BUFSIZ was too small a string to
hold the command to execute.  Use NMH_BUFSIZ instead.

8 years agoAfter further reflection, I decided I didn't like that previous
Ken Hornstein [Thu, 18 May 2017 03:28:02 +0000 (23:28 -0400)]
After further reflection, I decided I didn't like that previous
implementation.  Instead, allocate two ptys and connect one to standard
input and the other to standard output and standard error of the child
process.  After the first data is received from the slave, close the
master connected to standard input; that will generate an EOF on input
to the child process.  This ends up being much cleaner than looping and
waiting to send the EOF character to the child process.

8 years agoApparently on Linux if a slave pty is closed, instead of the master
Ken Hornstein [Thu, 18 May 2017 01:40:57 +0000 (21:40 -0400)]
Apparently on Linux if a slave pty is closed, instead of the master
getting an EOF they get an EIO, which strikes me as unfriendly.  So
make sure we exit the main read loop without complaint on an EOF or
error.

8 years agoSwitch from using script(1) to a new custom utility, runpty. It turns out
Ken Hornstein [Thu, 18 May 2017 01:00:47 +0000 (21:00 -0400)]
Switch from using script(1) to a new custom utility, runpty.  It turns out
on some systems script(1) has a bug that results in hangs that is simply
too difficult to test for, and this custom utility is simpler.

8 years agouip/mhbuildsbr.c: Fix long-line truncation when BUFSIZ is 1024.
Ralph Corderoy [Wed, 17 May 2017 14:15:18 +0000 (15:15 +0100)]
uip/mhbuildsbr.c: Fix long-line truncation when BUFSIZ is 1024.

a23477eb changed one char array from BUFSIZ to NMH_BUFSIZ elements, but
the long line read into it was passed to user_content() that
strncpy(3)'d it, silently truncating, to another char array, still
BUFSIZ long.  This show up on platforms where BUFSIZ is 1024 versus
NMH_BUFSIZ's minimum of 8192.

8 years agotest/common.sh.in: Clarify it's the first failure by a *named* test.
Ralph Corderoy [Wed, 17 May 2017 12:06:40 +0000 (13:06 +0100)]
test/common.sh.in: Clarify it's the first failure by a *named* test.

Unnamed tests may have failed earlier.

8 years agotest/mhbuild/test-cte: Move run_prog() to just before check().
Ralph Corderoy [Wed, 17 May 2017 11:58:15 +0000 (12:58 +0100)]
test/mhbuild/test-cte: Move run_prog() to just before check().

Prepare the input and output files, then run the program and check the
result.  Makes it easier to see every run is being checked if a,
sometimes large, expected-output file isn't being produced in between.

8 years agotest/mhbuild/test-cte: Add missing check() for earlier run_prog().
Ralph Corderoy [Wed, 17 May 2017 11:47:07 +0000 (12:47 +0100)]
test/mhbuild/test-cte: Add missing check() for earlier run_prog().

be6c3984 added a new run_prog and swiped the earlier check.

8 years agotest/common.sh.in: Clarify test name in failure message.
Ralph Corderoy [Wed, 17 May 2017 11:45:26 +0000 (12:45 +0100)]
test/common.sh.in: Clarify test name in failure message.

Some test names don't stand out as that when suffixed with `failed'
amidst all the other output.  Change `foo failed' to `first test
failure: foo' instead.  Also makes clear there's possibly other tests
that failed later.

8 years agoMake sure we are in the correct directory when we do "git describe".
Ken Hornstein [Wed, 17 May 2017 01:30:10 +0000 (21:30 -0400)]
Make sure we are in the correct directory when we do "git describe".

8 years agosbr/check_charset.c: Fix warning on unspecified struct initialisers.
Ralph Corderoy [Tue, 16 May 2017 23:27:54 +0000 (00:27 +0100)]
sbr/check_charset.c: Fix warning on unspecified struct initialisers.

A different C compiler disliked `{NULL}' as the initialiser for a
two-member struct so specify NULL for the other member too.

8 years agoRewrite norm_charmap(), moving code into data.
Ralph Corderoy [Tue, 16 May 2017 11:57:25 +0000 (12:57 +0100)]
Rewrite norm_charmap(), moving code into data.

Also removes return of static char array, and is more precise, e.g.
`CP1242' doesn't become `WINDOWS-1242' as it's not a known code page.

8 years agoMerge commit '3d0e5b6a4383a5228732edd6cb1532375b771262'
Ralph Corderoy [Tue, 16 May 2017 10:44:18 +0000 (11:44 +0100)]
Merge commit '3d0e5b6a4383a5228732edd6cb1532375b771262'

8 years agoMerge sbr/norm_charmap.c into sbr/check_charset.c.
Ralph Corderoy [Tue, 16 May 2017 10:35:49 +0000 (11:35 +0100)]
Merge sbr/norm_charmap.c into sbr/check_charset.c.

Alter norm_charmap() to be static now its only caller is in the same
file.  I've checked the upstream cam.ac.uk source and it's still the
same and hasn't changed in years, so I don't think there's much benefit
from having it standalone to ease checking.

8 years agoPart 1 of merging sbr/norm_charmap.c into sbr/check_charset.c.
Ralph Corderoy [Tue, 16 May 2017 10:29:17 +0000 (11:29 +0100)]
Part 1 of merging sbr/norm_charmap.c into sbr/check_charset.c.

This commit won't compile, but I'm attempting to get the rename into git
so the history after the next, merge, commit will continue through both
parents.

8 years agosbr/unquote.c: Move prototype from h/prototypes.h to new header.
Ralph Corderoy [Tue, 16 May 2017 10:21:50 +0000 (11:21 +0100)]
sbr/unquote.c: Move prototype from h/prototypes.h to new header.

8 years agosbr/mime_type.c: Move prototype from h/prototypes.h to new header.
Ralph Corderoy [Tue, 16 May 2017 09:59:07 +0000 (10:59 +0100)]
sbr/mime_type.c: Move prototype from h/prototypes.h to new header.

8 years agosbr/message_id.c: Move duplicate prototypes to new header.
Ralph Corderoy [Tue, 16 May 2017 09:53:17 +0000 (10:53 +0100)]
sbr/message_id.c: Move duplicate prototypes to new header.

8 years agosbr/makedir.c: Move prototype from h/prototypes.h to new header.
Ralph Corderoy [Tue, 16 May 2017 09:41:35 +0000 (10:41 +0100)]
sbr/makedir.c: Move prototype from h/prototypes.h to new header.

8 years agosbr/m_popen.c: Move prototypes from h/prototypes.h to new header.
Ralph Corderoy [Tue, 16 May 2017 09:36:02 +0000 (10:36 +0100)]
sbr/m_popen.c: Move prototypes from h/prototypes.h to new header.

8 years agosbr/m_maildir.c: Move prototypes from h/prototypes.h to new header.
Ralph Corderoy [Mon, 15 May 2017 23:30:59 +0000 (00:30 +0100)]
sbr/m_maildir.c: Move prototypes from h/prototypes.h to new header.

8 years agosbr/m_rand.c: Move prototype from h/prototypes.h to new header.
Ralph Corderoy [Mon, 15 May 2017 23:02:30 +0000 (00:02 +0100)]
sbr/m_rand.c: Move prototype from h/prototypes.h to new header.

8 years agoh/prototypes.h: Give sbr/lock_file.c's prototypes their own header.
Ralph Corderoy [Mon, 15 May 2017 22:54:05 +0000 (23:54 +0100)]
h/prototypes.h: Give sbr/lock_file.c's prototypes their own header.

8 years agosbr/utils.c: Delete unused upcase() function.
Ralph Corderoy [Mon, 15 May 2017 17:58:19 +0000 (18:58 +0100)]
sbr/utils.c: Delete unused upcase() function.

8 years agoh/utils.h: Move in PLURALS() macro from h/mh.h.
Ralph Corderoy [Mon, 15 May 2017 17:52:32 +0000 (18:52 +0100)]
h/utils.h: Move in PLURALS() macro from h/mh.h.

8 years agoh/prototypes.h: Remove duplicate prototype for pwd().
Ralph Corderoy [Mon, 15 May 2017 17:47:46 +0000 (18:47 +0100)]
h/prototypes.h: Remove duplicate prototype for pwd().

It is already in h/utils.h.

8 years agoh/utils.h: Move in nmh_init() prototype from h/prototypes.h.
Ralph Corderoy [Mon, 15 May 2017 17:39:45 +0000 (18:39 +0100)]
h/utils.h: Move in nmh_init() prototype from h/prototypes.h.

8 years agouip/mhshowsbr.h: Move in declarations from h/mhparse.h.
Ralph Corderoy [Mon, 15 May 2017 17:06:19 +0000 (18:06 +0100)]
uip/mhshowsbr.h: Move in declarations from h/mhparse.h.

Delete non-existent markerform parameter from show_all_messages()'s
comment.  Alter show_all_messages()'s definition's concatsw parameter to
match comment and prototype.

8 years agouip/mhshowsbr.c: Create header file with exports' declarations.
Ralph Corderoy [Mon, 15 May 2017 16:14:01 +0000 (17:14 +0100)]
uip/mhshowsbr.c: Create header file with exports' declarations.

Create a single set of externs for mhshowsbr.c's global variables.  Have
the other users of those use the new include file instead of their own
declarations.

8 years agouip/mhcachesbr.c: Move exported symbols to existing h/mhcachesbr.h.
Ralph Corderoy [Mon, 15 May 2017 15:09:28 +0000 (16:09 +0100)]
uip/mhcachesbr.c: Move exported symbols to existing h/mhcachesbr.h.

Remove the user's copies of the declarations.
A static struct swit caches[] was declared everywhere that included
h/mhcachesbr.h.  The larger number of includers causes `variable not
used' for `caches'.  Move that declaration to uip/mhcachesbr.c and have
an exported `cache_policy' symbol that points to it for the existing
users.

8 years agouip/mhoutsbr.c: Move exported prototype to new header file.
Ralph Corderoy [Mon, 15 May 2017 14:14:44 +0000 (15:14 +0100)]
uip/mhoutsbr.c: Move exported prototype to new header file.

Alter the callers to include the new header file instead of having their
own copy of the prototype.

8 years agosbr/m_mktemp.h: Move remaining prototypes from h/prototypes.h.
Ralph Corderoy [Mon, 15 May 2017 14:07:10 +0000 (15:07 +0100)]
sbr/m_mktemp.h: Move remaining prototypes from h/prototypes.h.

Gives the normal one header file showing interface exported by one C
file.

8 years agosbr/m_mktemp.h: Create with missing prototypes.
Ralph Corderoy [Mon, 15 May 2017 13:40:52 +0000 (14:40 +0100)]
sbr/m_mktemp.h: Create with missing prototypes.

Some of sbr/m_mktemp.c's functions didn't have prototypes in a header
file so callers were declaring prototypes themselves.  Have them include
the new header file instead.