From: Ralph Corderoy Date: Fri, 26 May 2017 22:34:10 +0000 (+0100) Subject: uip/mhparse.c: Fix body starting a byte too soon when no blank line. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/cfb444d37fc236a9fdac369cbcf2a5bfc37a33f5?ds=sidebyside;hp=cfb444d37fc236a9fdac369cbcf2a5bfc37a33f5 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. ---