Drooped support for -Wunused-macros and -Wno-unused-macros. The
warnings serve no useful purpose, and causing subsequent configure
checks for -Wfoo flags to get messed up.
Split each test of -Wfoo into a separate check. Include -Werror in
the individual flag tests to ensure the test compile fails if the
other flag isn't supported. Without this, clang issues a diagnostic
message about the flag being ignored, but otherwise carries on, fooling
configure into thinking the flag is in fact supported.
Update the section ordering to follow the UNIX order. This
pulls nmh-specific sections into the body of the manpage, and
pushes FILES, SEE ALSO, and BUGS to the end.
David Levine [Fri, 1 Feb 2013 01:44:47 +0000 (19:44 -0600)]
Removed sizes from mhlist output. Apparently tar files are
so much smaller on Solaris that they cause the check of its
output to break. The test also compares the contents of
the tar file, so it's still adequate.
David Levine [Fri, 1 Feb 2013 01:43:09 +0000 (19:43 -0600)]
Redirected stderr to /dev/null in the test for presence of
/dev/tty. Solaris warns that it can't create the device.
This may not fix it, but it should help isolate which part of
the test is causing the warning.
Lyndon Nerenberg [Thu, 31 Jan 2013 11:56:55 +0000 (03:56 -0800)]
Use cmp(1) to compare acheieved and expected test results.
'diff -c' on Solaris 11 generate a spurious 'No differences encountered'
message (on stdout, no less!) when the compared files are identical. This
changes the test logic to compare with 'cmp -s', and then perform a
'diff -c' if the results don't match expectations.
David Levine [Tue, 29 Jan 2013 03:38:39 +0000 (21:38 -0600)]
Changed m_getfld() buffer size to 4096 from 8192, to benefit
scan(1). We could consider using a larger buffer size when
readying message bodies. But I expect any benefit would be
overshadowed by the way parse_mime() currently reads MIME
messages: it reopens the file for each part.
David Levine [Tue, 29 Jan 2013 03:20:22 +0000 (21:20 -0600)]
Added m_getfld_track_filepos() for callers to indicate that they
may interleave fseek*/ftell* calls with m_getfld() calls. This
eliminates the need for m_getfld() to call fseek() when called
by inc(1) and scan(1).
David Levine [Sat, 26 Jan 2013 14:52:50 +0000 (08:52 -0600)]
Enabled colorized test output (PASS/FAIL/summary) by default
via "color-tests" automake option. To disable at runtime,
either set your AM_COLOR_TESTS environment variable to "no",
or provide that on the make check command line.
Ken Hornstein [Thu, 24 Jan 2013 21:05:36 +0000 (16:05 -0500)]
Fix the format engine so it properly keeps track of multibyte characters
and column positions when processing components and other functions.
When working on this code I realized we have nothing that checks to make
sure right justification of format function output works properly, so a
test for right justification is also included.
Ken Hornstein [Mon, 21 Jan 2013 15:32:37 +0000 (10:32 -0500)]
Fix a bug leading to message corruption with inc when incorporation more
than one message at a time.
When I reworked the scan() code to remove the use of stdio internals,
two code paths were created. The inc code path consumed another buffer
from the nxtbuf list for processing the message body. At the end of
scan() there was code to push back all of the consumed buffers to the
nxtbuf list. The extra buffer consumed in the inc code path wasn't
being pushed back, and as a result the nxtbuf list would end up with
duplicate pointers in it. This would result in two components sharing
the same text buffer, which caused the message corruption.
When I looked at this closer, I realized that there was no reason to
push those buffers back to the list; nxtbuf gets reset to compbuffers
at the start of every call to scan(), and nxtbuf isn't used after the
buffers are pushed back. Some researched revealed that this was the
same back in the original MH code. I decided it was simplest to simply
delete the buffer recycling code.
(cherry picked from commit 22d2acba60374851c291260ff6aa716e9bf44a6d)
Ken Hornstein [Mon, 21 Jan 2013 15:32:37 +0000 (10:32 -0500)]
Fix a bug leading to message corruption with inc when incorporation more
than one message at a time.
When I reworked the scan() code to remove the use of stdio internals,
two code paths were created. The inc code path consumed another buffer
from the nxtbuf list for processing the message body. At the end of
scan() there was code to push back all of the consumed buffers to the
nxtbuf list. The extra buffer consumed in the inc code path wasn't
being pushed back, and as a result the nxtbuf list would end up with
duplicate pointers in it. This would result in two components sharing
the same text buffer, which caused the message corruption.
When I looked at this closer, I realized that there was no reason to
push those buffers back to the list; nxtbuf gets reset to compbuffers
at the start of every call to scan(), and nxtbuf isn't used after the
buffers are pushed back. Some researched revealed that this was the
same back in the original MH code. I decided it was simplest to simply
delete the buffer recycling code.
David Levine [Mon, 21 Jan 2013 03:27:54 +0000 (21:27 -0600)]
Removed the static m_getfld() state instance and replaced
with functions for callers to create and destroy their own
instances. This also allows inc, msh, and pick to call
m_getfld() with an initial file stream position other than 0.
There is now a global state instance so that scan can call
m_unknown() on maildrop files. It'd be nice to get rid of
that.
David Levine [Sat, 19 Jan 2013 14:33:38 +0000 (08:33 -0600)]
Added a FILE * to the m_getfld_state struct so that most
functions don't need to pass it explicitly. Note that
m_getfld() must still be passed the FILE * because some
callers, e.g., those in mhparse.c, reopen their input file
and therefore pass different FILE *'s for the same input.
David Levine [Fri, 18 Jan 2013 03:58:50 +0000 (21:58 -0600)]
Removed all traces of m_getfld() FLDEOF and BODYEOF states.
They were never set by m_getfld(), so all caller code that
supported them was completely unexercised.