]> diplodocus.org Git - nmh/log
nmh
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.

8 years agosbr/utils.c: Use h/signals.h for setup_signal_handlers prototype.
Ralph Corderoy [Mon, 15 May 2017 13:31:36 +0000 (14:31 +0100)]
sbr/utils.c: Use h/signals.h for setup_signal_handlers prototype.

Deleted its own prototype for setup_signal_handlers() and added it to
the existing h/signals.h as it's defined in h/signals.c.

8 years agouip/picksbr.c: Use function prototypes for `nexus' functions.
Ralph Corderoy [Mon, 15 May 2017 13:23:53 +0000 (14:23 +0100)]
uip/picksbr.c: Use function prototypes for `nexus' functions.

Prototypes for ORaction(), etc., now state the parameters they expect.
Removed the args() macro, instead explicitly listing the arguments being
passed to functions.

8 years agoSpecify function parameters in prototypes, mainly void.
Ralph Corderoy [Mon, 15 May 2017 13:12:21 +0000 (14:12 +0100)]
Specify function parameters in prototypes, mainly void.

These prototypes are all in *.[cl] source compared with the *.h of the
earlier commit.  All but one had void added, that one's parameter was a
char pointer.

8 years agoh/prototypes.h: Remove scan_reset_m_getfld_state() prototype.
Ralph Corderoy [Mon, 15 May 2017 12:45:39 +0000 (13:45 +0100)]
h/prototypes.h: Remove scan_reset_m_getfld_state() prototype.

Function removed back in 2014 by 58eaf2c2.

8 years agoUse `void' in prototypes for functions with no parameters.
Ralph Corderoy [Mon, 15 May 2017 12:39:08 +0000 (13:39 +0100)]
Use `void' in prototypes for functions with no parameters.

The old-style `int foo()' still lived on in a few places.

8 years agoh/mhparse.h: Move mhfree.c's free_content prototype to new header.
Ralph Corderoy [Mon, 15 May 2017 12:29:28 +0000 (13:29 +0100)]
h/mhparse.h: Move mhfree.c's free_content prototype to new header.

It was the only thing of mhfree.c's in h/mhparse.h.

8 years agoMatch `NORETURN' function prototypes by adding it to definition.
Ralph Corderoy [Mon, 15 May 2017 12:25:23 +0000 (13:25 +0100)]
Match `NORETURN' function prototypes by adding it to definition.

8 years agoCreate and use header file for uip/mhfree.c's exports.
Ralph Corderoy [Mon, 15 May 2017 12:13:45 +0000 (13:13 +0100)]
Create and use header file for uip/mhfree.c's exports.

Remove all the duplicate inconsistent prototypes from mhfree.c's users.

8 years agotest/mhical/test-mhical: Force UTC timezone for mhical.
Ralph Corderoy [Mon, 15 May 2017 12:10:30 +0000 (13:10 +0100)]
test/mhical/test-mhical: Force UTC timezone for mhical.

Commit c3238c0e added a test but mhical's output depends on its
timezone;  force it to UTC for consistent results.

8 years agouip/mhfree.c: Make free_header() static.
Ralph Corderoy [Mon, 15 May 2017 11:52:23 +0000 (12:52 +0100)]
uip/mhfree.c: Make free_header() static.

8 years agouip/flist.c: Make locally defined and used functions static.
Ralph Corderoy [Mon, 15 May 2017 11:38:26 +0000 (12:38 +0100)]
uip/flist.c: Make locally defined and used functions static.

8 years agoSupport iCalendar event request files that don't end with a newline.
David Levine [Sun, 14 May 2017 21:27:23 +0000 (17:27 -0400)]
Support iCalendar event request files that don't end with a newline.

Such files do not conform to RFC 5545 ยง 3.1, which requires that each
contentline end with a CRLF.  But be liberal in what we accept.

8 years agoAdded explicit dependency to build sbr/icalparse.h before running LEX.
David Levine [Sun, 14 May 2017 17:08:03 +0000 (13:08 -0400)]
Added explicit dependency to build sbr/icalparse.h before running LEX.

"Fix" to commit 665dfc96.  The build had been relying upon the listed
order of files.

8 years agoHave post(1) report name of fileproc if it fails.
David Levine [Sun, 14 May 2017 16:18:35 +0000 (12:18 -0400)]
Have post(1) report name of fileproc if it fails.

8 years agoReplace calls to unputenv() with unsetenv(3).
Ralph Corderoy [Sun, 14 May 2017 22:17:36 +0000 (23:17 +0100)]
Replace calls to unputenv() with unsetenv(3).

8 years agoReplace calls to m_putenv() with setenv(3).
Ralph Corderoy [Sun, 14 May 2017 21:56:52 +0000 (22:56 +0100)]
Replace calls to m_putenv() with setenv(3).

8 years agosbr/dtimep.l: Remove redundant wrapping parenthesis in definitions.
Ralph Corderoy [Sun, 14 May 2017 18:35:13 +0000 (19:35 +0100)]
sbr/dtimep.l: Remove redundant wrapping parenthesis in definitions.

It's been decades since a lex(1) didn't follow POSIX and treat `{foo}'
as parenthesis surrounding foo's definition.  Other nmh lex files work
without the extra wrapping.

8 years agouip/mhstoresbr.c: Fix single-character nmh-storage bug.
Ralph Corderoy [Sun, 14 May 2017 11:53:33 +0000 (12:53 +0100)]
uip/mhstoresbr.c: Fix single-character nmh-storage bug.

If the profile component nmh-storage was a single character, e.g. the
relative directory `d', then it would be dropped from the output path so
instead of `d/foo' being written, `/foo' would probably fail.  I think
this was due to a faulty check for nmh-storage being `/'.  Add a test
for a non-/ single-character nmh-storage.

8 years agosbr/fmt_rfc2047.c: Simplify test for /^=\?./.
Ralph Corderoy [Sun, 14 May 2017 11:08:06 +0000 (12:08 +0100)]
sbr/fmt_rfc2047.c: Simplify test for /^=\?./.

8 years agoUse new PLURALS(n) macro instead of variety of tests.
Ralph Corderoy [Sun, 14 May 2017 10:23:33 +0000 (11:23 +0100)]
Use new PLURALS(n) macro instead of variety of tests.

Whether to output a plural noun in a message was decided by ternary
operators that tested n==1, n!=1, n>1, etc.  Make them all consistent by
using PLURALS(n).

8 years agouip/folder.c: Use `%s' for plural, not `%c'.
Ralph Corderoy [Sat, 13 May 2017 22:40:50 +0000 (23:40 +0100)]
uip/folder.c: Use `%s' for plural, not `%c'.

Instead of a ternary operator with 's' and ' ' as the outcomes, switch
the format specifier from `%c' to `%s' and use strings "s" and " ".

8 years agouip/folder.c: Rewrite plural test to common form.
Ralph Corderoy [Sat, 13 May 2017 17:39:06 +0000 (18:39 +0100)]
uip/folder.c: Rewrite plural test to common form.

The common form is a choice between "" and "s".  This one occurrence was
using " " and "s" so either output was a fixed width.  Alter the
printf(3) format string from `%s' to `%1s' to provide that instead.
Allows the new code to be altered by an upcoming `plural' change.

8 years agoMakefile.am: Alter long lists to be sorted, one entry per line.
Ralph Corderoy [Sat, 13 May 2017 17:35:15 +0000 (18:35 +0100)]
Makefile.am: Alter long lists to be sorted, one entry per line.

It was hard to see what files were included in some variables when
searching for the best place for new content.  Some variables had
definitions that were almost sorted, by weren't.  Switch to a
one-entry-per-line list, in `LC_ALL=C sort' order, documented at the
start of the file.  Makes it easy to run through the lists and see the
patterns.

8 years agoUse FENDNULL() instead of duplicate, locally defined, empty().
Ralph Corderoy [Sat, 13 May 2017 12:24:03 +0000 (13:24 +0100)]
Use FENDNULL() instead of duplicate, locally defined, empty().

Three files had an empty() that was defined using FENDNULL();  use the
latter directly.

8 years agoAdd FENDNULL(s): fends off NULL by giving an empty string instead.
Ralph Corderoy [Sat, 13 May 2017 12:13:18 +0000 (13:13 +0100)]
Add FENDNULL(s): fends off NULL by giving an empty string instead.

Use it in place of all the `foo->bar_xyzzy ? foo->bar_xyzzy : ""'.
Avoids the reader having to check first two of the ternary operands are
the same.

8 years agosbr/mf.c: Rename path to routepath to avoid h/mh.h clash.
Ralph Corderoy [Sat, 13 May 2017 11:56:58 +0000 (12:56 +0100)]
sbr/mf.c: Rename path to routepath to avoid h/mh.h clash.

Adding #include of h/mh.h brings two path global symbols together;
path() and char *path.  Rename the latter.  h/mh.h is needed by a future
commit.

8 years agoReplace `a == b ? 1 : 0' and similar with `a == b'.
Ralph Corderoy [Fri, 12 May 2017 22:29:31 +0000 (23:29 +0100)]
Replace `a == b ? 1 : 0' and similar with `a == b'.

8 years agoReplace `e ? 0 : 1' with `!e'.
Ralph Corderoy [Fri, 12 May 2017 22:14:43 +0000 (23:14 +0100)]
Replace `e ? 0 : 1' with `!e'.

Needs less thought to read.

8 years agosbr/icalparse.y: Replace max(BUFSIZ, 8192) with NMH_BUFSIZ.
Ralph Corderoy [Fri, 12 May 2017 21:45:34 +0000 (22:45 +0100)]
sbr/icalparse.y: Replace max(BUFSIZ, 8192) with NMH_BUFSIZ.

8 years agoUse existing macros min() and max() more.
Ralph Corderoy [Fri, 12 May 2017 21:42:35 +0000 (22:42 +0100)]
Use existing macros min() and max() more.

8 years agoClarified the phrasing added by commit 44ce2010.
David Levine [Fri, 12 May 2017 02:41:02 +0000 (22:41 -0400)]
Clarified the phrasing added by commit 44ce2010.

8 years agoAdded warning about when post(1) can't refile(1) a draft.
David Levine [Fri, 12 May 2017 00:20:16 +0000 (20:20 -0400)]
Added warning about when post(1) can't refile(1) a draft.

8 years agosbr/fmt_scan.c: Fix `foo%-42{bar}' right-justification bug.
Ralph Corderoy [Wed, 10 May 2017 11:13:28 +0000 (12:13 +0100)]
sbr/fmt_scan.c: Fix `foo%-42{bar}' right-justification bug.

The space padding was added at the start of the output buffer, not the
start of the component being formatted.  Caused by 92128dac's move to
dynamic allocation for fmt_scan()'s output.  Only shows if the component
isn't at the start of the buffer.  Expand existing
test/format/test-rightjustify to cover this.

8 years agoconfig/version.sh: Rewrite. Use uname(1), git-describe(1), and UTC.
Ralph Corderoy [Tue, 9 May 2017 22:10:06 +0000 (23:10 +0100)]
config/version.sh: Rewrite.  Use uname(1), git-describe(1), and UTC.

Not sure why it searched through PATH manually for uname(1) and
hostname(1).  uname and its -n option are POSIX so just use those.  It
was the preference over hostname anyway.

Use git-describe(1), not just git-branch(1), as it gives more detail,
including --dirty to show the built source differs from the commit.

Specify the format for the build date, and its timezone; +0000.

8 years agosbr/mf.c: Simplify isat(); it's /^ at /i.
Ralph Corderoy [Tue, 9 May 2017 21:48:11 +0000 (22:48 +0100)]
sbr/mf.c: Simplify isat();  it's /^ at /i.

This one's for all those RFC 733 emails out there.
You know who you are.

8 years agouip/inc.c: Use bool, not int, for some of the options.
Ralph Corderoy [Sun, 7 May 2017 22:30:46 +0000 (23:30 +0100)]
uip/inc.c: Use bool, not int, for some of the options.

Makes clear there's no special meaning to repeating these options more
than once.

8 years agosbr/netsec.c: Remove extraneous semicolon.
Ralph Corderoy [Sun, 7 May 2017 21:43:19 +0000 (22:43 +0100)]
sbr/netsec.c: Remove extraneous semicolon.

8 years agoSplit some comma-operator terms into separate statements.
Ralph Corderoy [Sun, 7 May 2017 21:35:41 +0000 (22:35 +0100)]
Split some comma-operator terms into separate statements.

Some uses of the comma operator weren't the idiomatic `p++, len--'.
Split its terms into two statements instead, e.g. `close(fd); fd = -1'.

8 years agouip/picksbr.c: Increase line-buffer size for "grep" action.
Ralph Corderoy [Sun, 7 May 2017 17:02:03 +0000 (18:02 +0100)]
uip/picksbr.c: Increase line-buffer size for "grep" action.

Alter LBSIZE from 1024 to NMH_BUFSIZ, e.g. 8192.  This dominates the
size of the char array used to hold a single unfolded header line when
evaluating a "grep" action, e.g. `-to foo' becomes `^to[ ^I]*:.*foo'.

8 years agouip/scansbr.c: Replace uses of SBUFSIZ with NMH_BUFSIZ.
Ralph Corderoy [Sun, 7 May 2017 13:01:48 +0000 (14:01 +0100)]
uip/scansbr.c: Replace uses of SBUFSIZ with NMH_BUFSIZ.

Now that the former is defined as the latter, the uses of SBUFSIZ were
all in the same expression and it simplifies from a ternary expression
to NMH_BUFSIZ.

8 years agouip/rcvdist.c: Replace SBUFSIZ with NMH_BUFSIZ.
Ralph Corderoy [Sun, 7 May 2017 12:57:39 +0000 (13:57 +0100)]
uip/rcvdist.c: Replace SBUFSIZ with NMH_BUFSIZ.

The former was defined as the latter and had only one proper use: to
size a char array.  The other uses should have been the sizeof operator
on that array, and now are.

8 years agouip/replsbr.c: Replace single use of SBUFSIZ with NMH_BUFSIZ.
Ralph Corderoy [Sun, 7 May 2017 12:56:40 +0000 (13:56 +0100)]
uip/replsbr.c: Replace single use of SBUFSIZ with NMH_BUFSIZ.

The former was defined as the latter;  not a lot of point having it.

8 years agoMake many m_getfld() buffer parameters NMH_BUFSIZ big.
Ralph Corderoy [Sun, 7 May 2017 12:03:01 +0000 (13:03 +0100)]
Make many m_getfld() buffer parameters NMH_BUFSIZ big.

char arrays were often stdio.h's BUFSIZ large, and that's 8192 with here
with glibc 2.25-1 on Linux x86_64, so using NMH_BUFSIZ is no different
as that's max(BUFSIZ, 8192).  But some were 256 or 512 with a local
SBUFSIZ macro and they caused scan(1) to truncate a field, or pick(1) to
not spot text because the field was truncated.

Delete bad-input/test-header's test for m_getfld()'s detection for a
header without a colon that's under the header-length NAMESZ limit, but
longer than the passed in buffer.  This no longer happens in scan as the
buffer is larger than the longest allowed header.

8 years agoconfigure.ac: Enable assert(3) by default.
Ralph Corderoy [Fri, 5 May 2017 12:11:15 +0000 (13:11 +0100)]
configure.ac: Enable assert(3) by default.

Revert 167e542b that disabled assert(3) by default after private email
discussion with David Levine.  I suggested it being enabled by default
in git so those running nmh from git were testing them for us, with it
being disabled as part of the release process so packagers continue with
it disabled.  David pointed out that would make the release
intentionally different from what had been long tested so the default is
now enabled assertions everywhere unless disabled by a packager.

8 years agomhstoresbr.c: Flip logic to simplify. Remove else after continue.
Ralph Corderoy [Mon, 1 May 2017 22:02:06 +0000 (23:02 +0100)]
mhstoresbr.c: Flip logic to simplify.  Remove else after continue.

Former in store_partial(), latter in parse_format_string().

8 years agomhlsbr.c: Flip parse()'s logic. Remove oneline()'s else after break.
Ralph Corderoy [Mon, 1 May 2017 21:57:44 +0000 (22:57 +0100)]
mhlsbr.c: Flip parse()'s logic.  Remove oneline()'s else after break.

8 years agodropsbr.c: Flip mbx_open()'s logic to simplify.
Ralph Corderoy [Mon, 1 May 2017 21:56:30 +0000 (22:56 +0100)]
dropsbr.c: Flip mbx_open()'s logic to simplify.

8 years agobase64.c: Remove some else after break. Flip logic to simplify.
Ralph Corderoy [Mon, 1 May 2017 21:47:38 +0000 (22:47 +0100)]
base64.c: Remove some else after break.  Flip logic to simplify.

8 years agomhfixmsg.c: Flip logic to simplify. Remove else after break.
Ralph Corderoy [Mon, 1 May 2017 21:46:38 +0000 (22:46 +0100)]
mhfixmsg.c: Flip logic to simplify.  Remove else after break.

8 years agopath.c: Simplify compath()'s flow; return, don't break twice.
Ralph Corderoy [Mon, 1 May 2017 21:36:30 +0000 (22:36 +0100)]
path.c: Simplify compath()'s flow;  return, don't break twice.

8 years agomhshowsbr.c: Remove else after break in iconv_start().
Ralph Corderoy [Mon, 1 May 2017 20:49:38 +0000 (21:49 +0100)]
mhshowsbr.c: Remove else after break in iconv_start().

8 years agomhparse.c: Remove a couple of else after continue.
Ralph Corderoy [Mon, 1 May 2017 20:46:20 +0000 (21:46 +0100)]
mhparse.c: Remove a couple of else after continue.

In openQuoted() and parse_header_attrs().

8 years agom_getfld.c: Remove else after break in m_unknown() and m_Eom().
Ralph Corderoy [Mon, 1 May 2017 20:43:36 +0000 (21:43 +0100)]
m_getfld.c: Remove else after break in m_unknown() and m_Eom().

8 years agopicksbr.c: Remove some else after break in plist().
Ralph Corderoy [Mon, 1 May 2017 20:42:59 +0000 (21:42 +0100)]
picksbr.c: Remove some else after break in plist().

8 years agofmt_rfc2047.c: Remove else after decode_rfc2047()'s break.
Ralph Corderoy [Mon, 1 May 2017 17:42:07 +0000 (18:42 +0100)]
fmt_rfc2047.c: Remove else after decode_rfc2047()'s break.

8 years agosortm.c: Flip get_fields()'s logic to simplify.
Ralph Corderoy [Mon, 1 May 2017 17:33:15 +0000 (18:33 +0100)]
sortm.c: Flip get_fields()'s logic to simplify.

8 years agoREADME.developers: Add pointers to Debian's Lintian's complaints.
Ralph Corderoy [Sun, 30 Apr 2017 14:25:20 +0000 (15:25 +0100)]
README.developers: Add pointers to Debian's Lintian's complaints.

8 years agoREADME.developers: Add blank lines for consistent headers.
Ralph Corderoy [Sun, 30 Apr 2017 14:14:46 +0000 (15:14 +0100)]
README.developers: Add blank lines for consistent headers.

8 years agoFix spelling in C comments.
Ralph Corderoy [Fri, 28 Apr 2017 23:01:58 +0000 (00:01 +0100)]
Fix spelling in C comments.