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.
David Levine [Fri, 18 Jan 2013 03:46:54 +0000 (21:46 -0600)]
Minimized message files reads in m_getfld() when the caller
interleaves calls to fseek(). Added check of handling of
long header field name without a colon to test-header.
David Levine [Thu, 17 Jan 2013 03:48:11 +0000 (21:48 -0600)]
Added check of header field body with more than 511
characters to test-inc-scanout. Also changed a couple of
test message files to be generated on the fly.
David Levine [Thu, 17 Jan 2013 02:13:04 +0000 (20:13 -0600)]
Cleaned up m_getfld() code a bit. The most notable change
was to remove the check for mmdlm2 not being null. It's
global data so that shouldn't happen.
David Levine [Wed, 16 Jan 2013 02:11:41 +0000 (20:11 -0600)]
Removed the for-loop that was used to get a header field
name in m_getfld (). It was no longer necessary when not
drawing directly from the stdio buffer.
David Levine [Tue, 15 Jan 2013 03:05:22 +0000 (21:05 -0600)]
In m_getfld(), fixed the loop that handles the FLDPLUS case.
In Getc(), removed the increment of the byte count at EOF,
it didn't seem correct or necessary.
David Levine [Tue, 15 Jan 2013 02:58:56 +0000 (20:58 -0600)]
m_getfld() now supports interleaving calls with
fseek()/ftell(). Reverted the changes to uip/mhparse.c of
commit 484eb1003ae647e4b751e4d7829c7daf44fb99c9 because
they're no longer necessary.
David Levine [Sat, 12 Jan 2013 16:58:31 +0000 (10:58 -0600)]
Cleaned up FLDPLUS handling in m_getfld(). As part of this,
removed the backing up of the read pointer in the "something
went wrong" portion of the FLD handling. It had been moved
back two positions. The first is no longer necessary
because a Getc() was replace by a Peek(), and the second
caused the extra blank line noted in the old comments.
Updated the expected output in test/bad-input/test-header to
correspond.