]> diplodocus.org Git - nmh/commitdiff
OK, fixed test-mhfixmsg on Solaris 11, where BUFSIZ is 1024.
authorDavid Levine <levinedl@acm.org>
Sun, 30 Jun 2013 23:50:50 +0000 (18:50 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 30 Jun 2013 23:50:50 +0000 (18:50 -0500)
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.

test/mhfixmsg/test-mhfixmsg
uip/mhfixmsg.c

index cfe21af3f413eb96d47b6fd5ed67bdc156f4d1c7..3bffa9a8be06e75e3189adb01c4092c3873be658 100755 (executable)
@@ -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: <me@example.com>
-From: <sender@example.com>
-Subject: body requires binary encoding
-
-<body>
-<table width=3D"325" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">
-<tr><td><font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" size=
-=3D"2"><strong>Mile</strong></font></td><td height=3D"3">&nbsp;</td><td ali=
-gn=3D"right"><font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" =
-size=3D"2">$0.00</font></td></tr><tr><td><font face=3D"Arial, Helvetica, sa=
-ns-serif" color=3D"#333333" size=3D"2"><strong>Time</strong></font></td><td=
- height=3D"3">&nbsp;</td><td align=3D"right"><font face=3D"Arial, Helvetica=
-, sans-serif" color=3D"#333333" size=3D"2">$78.71</font></td></tr><tr><td><=
-font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" size=3D"2"><st=
-rong>State Tax</strong></font></td><td height=3D"3">&nbsp;</td><td align=3D=
-"right"><font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" size=
-=3D"2">$5.90</font></td></tr><tr><td><font face=3D"Arial, Helvetica, sans-s=
-erif" color=3D"#333333" size=3D"2"><strong>Vehicle License Fee</strong></fo=
-nt></td><td height=3D"3">&nbsp;</td><td align=3D"right"><font face=3D"Arial=
-, Helvetica, sans-serif" color=3D"#333333" size=3D"2">$1.84</font></td></tr=
-><tr><td><font face=3D"Arial, Helvetica, sans-serif" color=3D"#333333" size=
-=3D"2"><strong>State Txn Tax</strong></font></td><td height=3D"3">&nbsp;</t=
-d><td align=3D"right"><font face=3D"Arial, Helvetica, sans-serif" color=3D"=
-#333333" size=3D"2">$6.00</font></td></tr>
-
-</body>
-</html>
-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
index 1f1065c3c2f068fafe013f28162572475a44bd50..ff189a0edfb426d9c79d312ab7f03852bce96822 100644 (file)
@@ -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;