]> diplodocus.org Git - nmh/commitdiff
uip/mhparse.c: Fix body starting a byte too soon when no blank line.
authorRalph Corderoy <ralph@inputplus.co.uk>
Fri, 26 May 2017 22:34:10 +0000 (23:34 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Fri, 26 May 2017 22:34:10 +0000 (23:34 +0100)
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.


No differences found