From: David Levine Date: Sun, 30 Jun 2013 23:50:50 +0000 (-0500) Subject: OK, fixed test-mhfixmsg on Solaris 11, where BUFSIZ is 1024. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/479301db377df555594b72bbaae3be9d640e3e02?ds=inline;hp=-c OK, fixed test-mhfixmsg on Solaris 11, where BUFSIZ is 1024. The problem was in the content_encoding() function of mhfixmsg: it would restart its counter of the characters on a line whenever new characters were read in. The fix was easy, just move the initialization of that counter outside of the fread() loop. --- 479301db377df555594b72bbaae3be9d640e3e02 diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index cfe21af3..3bffa9a8 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -64,51 +64,6 @@ case `mhfixmsg -version` in failed=`expr ${failed:-0} + 1`;; esac -# ???? -cat >`mhpath new` <<'EOF' -MIME-Version: 1.0 -Content-Type: text/html; charset="ISO-8859-1" -Content-Transfer-Encoding: quoted-printable -Date: Thu, 11 Apr 2013 02:47:08 -0700 -To: -From: -Subject: body requires binary encoding - - - -  - - - -EOF - -if [ $can_reformat_texthtml -eq 1 ]; then - #### lynx inserts multiple blank lines, so use uniq to squeeze them. - mhfixmsg last -outfile - | uniq >"$actual" - check "$expected" "$actual" 'ignore space' -else - cp -p "$MH_TEST_DIR/Mail/inbox/15" "$MH_TEST_DIR/Mail/inbox/15.backup" - rm -f "$expected" -fi -exit # ???? - # check that non-MIME messages aren't modified # check -outfile diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 1f1065c3..ff189a0e 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -1543,6 +1543,7 @@ content_encoding (CT ct) { int encoding = CE_7BIT; if (ce->ce_file) { + size_t line_len = 0; char buffer[BUFSIZ]; size_t inbytes; @@ -1556,13 +1557,9 @@ content_encoding (CT ct) { (inbytes = fread (buffer, 1, sizeof buffer, ce->ce_fp)) > 0) { char *cp; size_t i; - size_t line_len = 0; int last_char_was_cr = 0; - fprintf (stderr, "%s:%d; (%ld bytes) %*s\n", __FILE__, __LINE__, (long) inbytes, inbytes, buffer); /* ???? */ - for (i = 0, cp = buffer; i < inbytes; ++i, ++cp) { - fprintf (stderr, "line_len=%d\n", line_len); /* ???? */ if (*cp == '\0' || ++line_len > 998 || (*cp != '\n' && last_char_was_cr)) { encoding = CE_BINARY;
Mile $0.00
Time$78.71
<= -font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" size=3D"2">State Tax $5.90
Vehicle License Fee $1.84
State Txn Tax $6.00