]> diplodocus.org Git - nmh/commitdiff
Merge branch 'encode-rfc2047'
authorKen Hornstein <kenh@pobox.com>
Wed, 4 Dec 2013 02:52:30 +0000 (21:52 -0500)
committerKen Hornstein <kenh@pobox.com>
Wed, 4 Dec 2013 02:52:30 +0000 (21:52 -0500)
25 files changed:
Makefile.am
configure.ac
docs/contrib/build_nmh
docs/pending-release-notes
h/fmt_scan.h
h/prototypes.h
man/mhfixmsg.man
man/mhlist.man
man/rcvpack.man
sbr/addrsbr.c
sbr/snprintb.c
test/dist/test-dist
test/mhfixmsg/test-mhfixmsg
test/mhlist/test-mhlist
test/mhshow/test-charset [new file with mode: 0755]
uip/dropsbr.c
uip/fmttest.c
uip/inc.c
uip/mhfixmsg.c
uip/mhlist.c
uip/mhlistsbr.c
uip/msgchk.c
uip/post.c
uip/replsbr.c
uip/scansbr.c

index 1951956..a056b24 100644 (file)
@@ -68,6 +68,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \
        test/mhfixmsg/test-mhfixmsg \
        test/mhlist/test-mhlist test/mhmail/test-mhmail \
        test/mhparam/test-mhparam test/mhpath/test-mhpath \
+       test/mhshow/test-charset \
        test/mhshow/test-cte-binary test/mhshow/test-qp \
        test/mhshow/test-subpart test/mhshow/test-msg-buffer-boundaries \
        test/mhstore/test-mhstore test/new/test-basic \
@@ -583,6 +584,7 @@ man/man.sed: Makefile
        @echo 's,%nmhwarning%,THIS FILE HAS BEEN AUTOMATICALLY GENERATED.  DO NOT EDIT.,g' > $@
        @echo 's,%nmhversion%,nmh-$(VERSION),g' >> $@
        @echo 's,%bindir%,$(bindir),g' >> $@
+       @echo 's,%docdir%,$(docdir),g' >> $@
        @echo 's,%etcdir%,$(sysconfdir),g' >> $@
        @echo 's,%libdir%,$(libdir),g' >> $@
        @echo 's,%mandir%,$(mandir),g' >> $@
index fac9b91..38e2a58 100644 (file)
@@ -235,7 +235,7 @@ AC_PATH_PROG([sendmailpath], [sendmail], [/usr/sbin/sendmail], [$pathtmp])
 dnl Cygwin FAT filesystems do not support hard links.  So default to
 dnl cp instead, even if running on an NTFS or other filesystem.
 AS_CASE(["$host_os"],
-  [cygwin*],[LN=cp],
+  [cygwin*], [LN=cp],
   [LN=ln])
 AC_SUBST([LN])
 
@@ -556,6 +556,20 @@ dnl Now put the libraries back to what it was before we
 dnl starting checking the termcap library.
 LIBS="$nmh_save_LIBS"
 
+dnl ----------------
+dnl CHECK FLEX FIXUP
+dnl ----------------
+dnl Use LFLAGS make variable setting to work around bugs in flex
+dnl 2.5.35-37 that cause signed/unsigned mismatch,
+dnl http://sourceforge.net/p/flex/bugs/140/
+AS_IF([test "$LEX" = flex],
+      [AS_CASE([`$LEX -V`],
+               [flex\ 2.5.35], [[LFLAGS=\
+'; printf "%s\n" '\''1,$$s/(size_t) \(num_to_read\)/\1/'\'' w q | ed -s $@']],
+               [flex\ 2.5.3@<:@67@:>@], [[LFLAGS=\
+'; printf "%s\n" '\''1,$$s/\(  \)int i;/\1yy_size_t i;/'\'' w q | ed -s $@']])
+       AC_SUBST([LFLAGS])])
+
 dnl --------------
 dnl CHECK TYPEDEFS
 dnl --------------
index ef399f8..adc6e1c 100755 (executable)
@@ -307,15 +307,14 @@ if [ $status -eq 0 ]; then
   fi
 fi
 
-grep 'Error' "$logfile"
-#### Ignore the warning when sbr/dtimep.c is built with flex 2.5.36
-#### or 2.5.37.
-grep 'warn' "$logfile" | \
-  grep -v 'sbr/dtimep.c:.*comparison between signed and unsigned'
-if [ $status -ne 0 ]; then
+grep Error "$logfile"
+grep warn "$logfile"
+
+if [ $status -eq 0 ]; then
+  [ $verbose -ge 1 ]  &&  echo build completed successfully
+else
   echo build failed!
   echo build log is in "$logfile"
 fi
-[ $status -eq 0  -a  $verbose -ge 1 ]  &&  echo build completed successfully
 
 exit $status
index b04f610..8295c33 100644 (file)
@@ -57,6 +57,7 @@ NEW FEATURES
   connection with the -initialtls switch.
 - Messages can now be selected using a relative offset from some other
   message, or from the start or end of a sequence.  See mh-sequences(5).
+- The -changecur and -nochangecur switches have been added to mhlist(1).
 
 -----------------
 OBSOLETE FEATURES
index 50b597e..771d9fb 100644 (file)
@@ -37,6 +37,8 @@ struct comp {
 #define        CT_ADDR       (1<<0)    /* referenced as address    */
 #define        CT_DATE       (1<<1)    /* referenced as date       */
 
+#define CT_BITS       "\020\01ADDR\02DATE"
+
 /*
  * c_flags bits
  */
@@ -45,6 +47,8 @@ struct comp {
 #define        CF_DATEFAB    (1<<2)    /* datefield fabricated */
 #define CF_TRIMMED    (1<<3)   /* Component has been trimmed */
 
+#define CF_BITS       "\020\01TRUE\02PARSED\03CF_DATEFAB\04TRIMMED"
+
 extern int fmt_norm;
 
 /*
index 6db9995..3797fec 100644 (file)
@@ -207,7 +207,40 @@ void seq_setprev (struct msgs *);
 void seq_setunseen (struct msgs *, int);
 int showfile (char **, char *);
 int smatch(char *, struct swit *);
-char *snprintb (char *, size_t, unsigned, char *);
+
+/*
+ * Convert a set of bit flags to printable format.
+ *
+ * Arguments:
+ *
+ * buffer      - Buffer to output string to.
+ * size                - Size of buffer in bytes.  Buffer is always NUL terminated.
+ * flags       - Binary flags to output
+ * bitfield    - Textual representation of bits to output.  This string
+ *               is in the following format:
+ *
+ *     Option byte 0x01 STRING1 0x02 STRING2 ....
+ *
+ * The first byte is an option byte to snprintb().  Currently the only option
+ * supported is 0x08, which indicates that the flags should be output in
+ * octal format; if the option byte is any other value, the flags will be
+ * output in hexadecimal.
+ *
+ * After the option bytes are series of text strings, prefixed by the number
+ * of the bit they correspond to.  For example, the bitfield string:
+ *
+ *     "\020\01FLAG1\02FLAG2\03FLAG3\04FLAG4"
+ *
+ * will output the following string if "flags" is set to 0x09:
+ *
+ *     0x2<FLAG1,FLAG4>
+ *
+ * You don't have to use octal in the bitfield string, that's just the
+ * convention currently used by the nmh code.  The order of flags in the
+ * bitfield string is not significant, but again, general convention is
+ * from least significant bit to most significant.
+ */
+char *snprintb (char *buffer, size_t size, unsigned flags, char *bitfield);
 int ssequal (char *, char *);
 int stringdex (char *, char *);
 char *trimcpy (char *);
index fcc6dca..f45447b 100644 (file)
@@ -1,4 +1,4 @@
-.TH MHFIXMSG %manext1% "May 4, 2013" "%nmhversion%"
+.TH MHFIXMSG %manext1% "October 27, 2013" "%nmhversion%"
 .\"
 .\" %nmhwarning%
 .\"
@@ -9,7 +9,10 @@ mhfixmsg \- rewrite MIME messages with various transformations
 .na
 .B mhfixmsg
 .RI [ +folder ]
-.RI [ msgs ]
+.RI [ msgs " | "
+.IR "absolute pathname" " | "
+.RB \-file
+.IR file ]
 .RB [ \-decodetext
 8bit/7bit |
 .BR \-nodecodetext ]
@@ -20,8 +23,6 @@ mhfixmsg \- rewrite MIME messages with various transformations
 .RB [ \-replacetextplain " | " \-noreplacetextplain ]
 .RB [ \-fixboundary " | " \-nofixboundary ]
 .RB [ \-fixcte " | " \-nofixcte ]
-.RB [ \-file
-.IR file ]
 .RB [ \-outfile
 .IR outfile ]
 .RB [ \-rmmproc
@@ -155,7 +156,12 @@ switch directs
 .B mhfixmsg
 to use the specified
 file as the source message, rather than a message from a folder.
-If this file is \*(lq-\*(rq, then
+Only one file argument may be provided.  The
+.B \-file
+switch is implied if
+.I file
+is an absolute pathname.
+If the file is \*(lq-\*(rq, then
 .B mhfixmsg
 accepts the source message on the standard input stream.  If
 the
@@ -238,6 +244,24 @@ profile component and negates all prior
 .B \-rmmproc
 switches.
 .PP
+.SS "Integration with inc"
+.B mhfixmsg
+can be used as an add-hook, as described in %docdir%/README-HOOKS.
+Note that add-hooks are called from all
+.B nmh
+programs that add a message to a folder, not just
+.BR inc .
+Alternatively, a simple shell alias or function can be used to
+call
+.B mhfixmsg
+immediately after a successful invocation of
+.BR inc .
+For example, with bash:
+.PP
+.RS 5
+alias inc='inc && mhfixmsg'
+.RE
+.PP
 .SS "Integration with procmail"
 By way of example, here is an excerpt from a procmailrc file
 that filters messages through
@@ -296,6 +320,7 @@ is checked.
 ^rmmproc:~^Program to delete original messages or files
 .fi
 .SH "SEE ALSO"
+.IR inc (1),
 .IR mh-profile (5),
 .IR mhbuild (1),
 .IR mhlist (1),
@@ -322,4 +347,5 @@ If a folder is given, it will become the current folder.  The last
 message selected from a folder will become the current message.  If
 the
 .B \-file
-switch is used, the context will not be modified.
+switch or an absolute pathname is used, the context will not be
+modified.
index bd8f080..46b7563 100644 (file)
@@ -25,6 +25,7 @@ mhlist \- list information about MIME messages
 .RB [ \-wcache
 .IR policy ]
 .RB [ \-check " | " \-nocheck ]
+.RB [ \-changecur " | " \-nochangecur ]
 .RB [ \-verbose " | " \-noverbose ]
 .RB [ \-version ]
 .RB [ \-help ]
@@ -184,8 +185,11 @@ integrity of the content.
 .RB ` \-realsize '
 .RB ` \-rcache\ ask '
 .RB ` \-wcache\ ask '
+.RB ` \-changecur '
 .RB ` \-noverbose '
 .fi
 .SH CONTEXT
 If a folder is given, it will become the current folder.  The last
-message selected will become the current message.
+message selected will become the current message, unless the
+.B \-nochangecur
+option is specified.
index a3763f1..fc18abe 100644 (file)
@@ -35,7 +35,7 @@ CTRL\-A's and a newline.
 .B rcvpack
 will correctly lock and unlock the file to serialize
 access to the file, when running multiple copies of
-.B rcvpack .
+.BR rcvpack .
 .PP
 In general, its use is obsoleted by the
 .B file
index a073e70..e5b2052 100644 (file)
@@ -242,10 +242,13 @@ auxformat (struct mailname *mp, int extras)
            strncpy (addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr));
        else
 
-       if (mp->m_type != UUCPHOST)
-           snprintf (addr, sizeof(addr), mp->m_host ? "%s%s@%s" : "%s%s",
-               empty(mp->m_path), empty(mp->m_mbox), mp->m_host);
-       else
+       if (mp->m_type != UUCPHOST) {
+           if (mp->m_host)
+               snprintf (addr, sizeof(addr), "%s%s@%s", empty(mp->m_path),
+                         empty(mp->m_mbox), mp->m_host);
+           else snprintf (addr, sizeof(addr), "%s%s", empty(mp->m_path),
+                          empty(mp->m_mbox));
+       } else
            snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox);
 
     if (!extras)
index 5f3f124..629da4b 100644 (file)
@@ -18,21 +18,28 @@ snprintb (char *buffer, size_t n, unsigned v, char *bits)
 
     snprintf (buffer, n, bits && *bits == 010 ? "0%o" : "0x%x", v);
     bp = buffer + strlen(buffer);
+    n -= strlen(buffer);
 
     if (bits && *++bits) {
        j = 0;
        *bp++ = '<';
-       while ((i = *bits++))
+       while ((i = *bits++) && n > 1)
            if (v & (1 << (i - 1))) {
-               if (j++)
+               if (j++ && n > 1) {
                    *bp++ = ',';
-               for (; (c = *bits) > 32; bits++)
+                   n--;
+               }
+               for (; (c = *bits) > 32 && n > 1; bits++) {
                    *bp++ = c;
+                   n--;
+               }
            }
            else
                for (; *bits > 32; bits++)
                    continue;
-       *bp++ = '>';
+       if (n > 1)
+           *bp++ = '>';
+
        *bp = 0;
     }
 
index ca6a70b..c5182af 100755 (executable)
@@ -247,21 +247,21 @@ EOF
 
   # check -inplace
   # Hard link the message and verify that the new one does get annotated.
-  ln "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
+  ln "${MH_TEST_DIR}/Mail/inbox/9" "${MH_TEST_DIR}/Mail/inbox/9.link"
   cat >"$expected" <<EOF
-From: Test8 <test8@example.com>
+From: Test9 <test9@example.com>
 To: Some User <user@example.com>
 Date: Fri, 29 Sep 2006 00:00:00
-Message-Id: 8@test.nmh
-Subject: Testing message 8
+Message-Id: 9@test.nmh
+Subject: Testing message 9
 Resent-From: ${localmbox}
 Resent-To: somebody@example.com
 Resent-Date:
 
-This is message number 8
+This is message number 9
 EOF
-  test_dist 8 -noedit -to somebody@example.com -annotate -noinplace -inplace
-  check "${MH_TEST_DIR}/Mail/inbox/8" "${MH_TEST_DIR}/Mail/inbox/8.link"
+  test_dist 9 -noedit -to somebody@example.com -annotate -noinplace -inplace
+  check "${MH_TEST_DIR}/Mail/inbox/9" "${MH_TEST_DIR}/Mail/inbox/9.link"
 fi
 
 # check -draftfolder
index ac01323..9c2df41 100755 (executable)
@@ -249,6 +249,10 @@ else
 fi
 
 
+# check implicit -file with absolute pathname
+run_test "mhfixmsg `mhpath last` -outfile /dev/null" ''
+
+
 # check handling of boundary string that appears in message body
 #
 cat >"$expected" <<EOF
index cb79367..ad0fb4b 100755 (executable)
@@ -172,6 +172,13 @@ run_test 'mhlist last -part 2 -noheader -check -nocheck' \
      1     multipart/related          180
      2     text/plain                  36'
 
+#
+# Set the cur sequence to 1 to test default behavior of changecur after
+# this test.
+#
+
+mark 1 -sequence cur -add -zero
+
 # check -verbose
 run_test 'mhlist 11 -verbose -noheader' \
 '  11       multipart/mixed            936
@@ -189,5 +196,18 @@ run_test 'mhlist 11 -verbose -noheader' \
      4     text/plain                  36
             charset="iso-8859-1"'
 
+#
+# Check default changecur behavior
+#
+
+run_test 'mark -sequence cur -list' 'cur: 11'
+
+#
+# Now test -nochangecur
+#
+
+mhlist -nochangecur 1 >/dev/null
+
+run_test 'mark -sequence cur -list' 'cur: 11'
 
 exit $failed
diff --git a/test/mhshow/test-charset b/test/mhshow/test-charset
new file mode 100755 (executable)
index 0000000..64c9812
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+######################################################
+#
+# Test charset conversion functionality
+#
+######################################################
+
+set -e
+
+if test -z "${MH_OBJ_DIR}"; then
+    srcdir=`dirname "$0"`/../..
+    MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
+fi
+
+. "$MH_OBJ_DIR/test/common.sh"
+
+setup_test
+
+expected=$MH_TEST_DIR/$$.expected
+actual=$MH_TEST_DIR/$$.actual
+
+echo 'mhshow-charset-windows-1252: echo "This is a test"' >> $MH_TEST_DIR/Mail/.mh_profile
+
+# Write message with bogus quoted-printable data.
+msgfile=`mhpath new`
+msgnum=`basename $msgfile`
+cat > $msgfile <<EOF
+From: foo@example.edu
+To: bar@example.edu
+Subject: test
+MIME-Version: 1.0
+Content-Type: text/plain; charset=windows-1252
+Content-Transfer-Encoding: quoted-printable
+Date: Sun, 18 Dec 2005 00:52:39 +0100
+
+4 =F7 2 =3D 2
+EOF
+
+cat > $expected <<EOF
+Date:    Sun, 18 Dec 2005 00:52:39 +0100
+To:      bar@example.edu
+From:    foo@example.edu
+Subject: test
+
+MIME-Version: 1.0
+
+part       text/plain                  10
+This is a test
+EOF
+
+mhshow -nopause $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+exit $failed
index 5fcef29..e97ab62 100644 (file)
@@ -40,7 +40,7 @@ static int map_open (char *, int);
 int
 mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode)
 {
-    int j, count, fd;
+    int j, count, fd = NOTOK;
     struct stat st;
 
     j = 0;
index 858732c..4794c7b 100644 (file)
@@ -60,7 +60,7 @@ static struct format **lvec = NULL;
 static int lused = 0;
 static int lallocated = 0;
 
-enum mode_t { MESSAGE, ADDRESS, RAW };
+enum mode_t { MESSAGE, ADDRESS, DATE, RAW };
 #define DEFADDRFORMAT "%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>"
 #define DEFDATEFORMAT "%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>"
 
@@ -223,7 +223,7 @@ main (int argc, char **argv)
                    dupaddrs = 0;
                    continue;
                case DATESW:
-                   mode = RAW;
+                   mode = DATE;
                    defformat = DEFDATEFORMAT;
                    continue;
 
@@ -406,7 +406,7 @@ main (int argc, char **argv)
            fmt_norm = normalize;
            process_addresses(fmt, &msgs, buffer, bufsize, outputsize,
                              dat, normalize, cbp);
-       } else
+       } else /* Fall-through for RAW or DATE */
            process_raw(fmt, &msgs, buffer, bufsize, outputsize, dat, cbp);
     }
 
@@ -1143,47 +1143,23 @@ f_typestr(int t)
        }
 }
 
-#define FNORD(v, s) if (t & (v)) { \
-       if (i++ > 0) \
-               strcat(buf, "|"); \
-       strcat(buf, s); }
-
 static char *
 c_typestr(int t)
 {
-       register int i;
        static char buf[64];
 
-       buf[0] = '\0';
-       if (t & ~(CT_ADDR|CT_DATE))
-               printf(buf, "0x%x ", t);
-       strcat(buf, "<");
-       i = 0;
-       FNORD(CT_ADDR, "ADDR");
-       FNORD(CT_DATE, "DATE");
-       strcat(buf, ">");
+       snprintb(buf, sizeof(buf), t, CT_BITS);
        return(buf);
 }
 
 static char *
 c_flagsstr(int t)
 {
-       register int i;
        static char buf[64];
 
-       buf[0] = '\0';
-       if (t & ~(CF_TRUE|CF_PARSED|CF_DATEFAB|CF_TRIMMED))
-               printf(buf, "0x%x ", t);
-       strcat(buf, "<");
-       i = 0;
-       FNORD(CF_TRUE, "TRUE");
-       FNORD(CF_PARSED, "PARSED");
-       FNORD(CF_DATEFAB, "DATEFAB");
-       FNORD(CF_TRIMMED, "TRIMMED");
-       strcat(buf, ">");
+       snprintb(buf, sizeof(buf), t, CF_BITS);
        return(buf);
 }
-#undef FNORD
 
 static void
 litputs(char *s)
index cd98ddb..0e52744 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -547,10 +547,15 @@ go_to_it:
        else if (i == NOTOK)
            chmod (audfile, m_gmprot ());
 
-       fprintf (aud, from ? "<<inc>> %s -ms %s\n"
-                : host ? "<<inc>> %s -host %s -user %s\n"
-                : "<<inc>> %s\n",
-                dtimenow (0), from ? from : host, user);
+       if (from)
+           fprintf (aud, "<<inc>> %s -ms %s\n", dtimenow(0), from);
+       else {
+           if (host)
+               fprintf (aud, "<<inc>> %s -host %s -user %s\n", dtimenow(0),
+                        host, user);
+           else
+               fprintf (aud, "<<inc>> %s\n", dtimenow (0));
+       }
     }
 
     /* Get new format string */
index 829697c..10e9af5 100644 (file)
@@ -215,19 +215,16 @@ main (int argc, char **argv) {
             case NREPLACETEXTPLAINSW:
                 fx.replacetextplain = 0;
                 continue;
-
             case FILESW:
                 if (! (cp = *argp++) || (*cp == '-' && cp[1]))
                     adios (NULL, "missing argument to %s", argp[-2]);
                 file = *cp == '-'  ?  add (cp, NULL)  :  path (cp, TFILE);
                 continue;
-
             case OUTFILESW:
                 if (! (cp = *argp++) || (*cp == '-' && cp[1]))
                     adios (NULL, "missing argument to %s", argp[-2]);
                 outfile = *cp == '-'  ?  add (cp, NULL)  :  path (cp, TFILE);
                 continue;
-
             case RPROCSW:
                 if (!(rmmproc = *argp++) || *rmmproc == '-')
                     adios (NULL, "missing argument to %s", argp[-2]);
@@ -235,7 +232,6 @@ main (int argc, char **argv) {
             case NRPRCSW:
                 rmmproc = NULL;
                 continue;
-
             case VERBSW:
                 verbosw = 1;
                 continue;
@@ -249,8 +245,14 @@ main (int argc, char **argv) {
                 adios (NULL, "only one folder at a time!");
             else
                 folder = pluspath (cp);
-        } else
-                app_msgarg(&msgs, cp);
+        } else {
+            if (*cp == '/') {
+                /* Interpret a full path as a filename, not a message. */
+                file = add (cp, NULL);
+            } else {
+                app_msgarg (&msgs, cp);
+            }
+        }
     }
 
     SIGNAL (SIGQUIT, quitser);
@@ -1732,8 +1734,8 @@ strip_crs (CT ct, int *message_mods) {
 
                     ++*message_mods;
                     if (verbosw) {
-                        report (NULL,
-                                 begin == 0 && end == 0 ? "(tmpfile)" : *file,
+                        report (ct->c_partno,
+                                begin == 0 && end == 0  ?  ""  :  *file,
                                 "stripped CRs");
                     }
                 }
index c63cf88..f6208dd 100644 (file)
@@ -32,6 +32,8 @@
     X("type content", 0, TYPESW) \
     X("rcache policy", 0, RCACHESW) \
     X("wcache policy", 0, WCACHESW) \
+    X("changecur", 0, CHGSW) \
+    X("nochangecur", 0, NCHGSW) \
     X("version", 0, VERSIONSW) \
     X("help", 0, HELPSW) \
     X("debug", -5, DEBUGSW) \
@@ -96,7 +98,7 @@ static void pipeser (int);
 int
 main (int argc, char **argv)
 {
-    int sizesw = 1, headsw = 1;
+    int sizesw = 1, headsw = 1, chgflag = 1;
     int msgnum, *icachesw;
     char *cp, *file = NULL, *folder = NULL;
     char *maildir, buf[100], **argp;
@@ -203,6 +205,13 @@ do_cache:
                file = *cp == '-' ? cp : path (cp, TFILE);
                continue;
 
+           case CHGSW:
+               chgflag++;
+               continue;
+           case NCHGSW:
+               chgflag = 0;
+               continue;
+
            case VERBSW: 
                verbosw = 1;
                continue;
@@ -341,7 +350,8 @@ do_cache:
     /* If reading from a folder, do some updating */
     if (mp) {
        context_replace (pfolder, folder);/* update current folder  */
-       seq_setcur (mp, mp->hghsel);      /* update current message */
+       if (chgflag)
+           seq_setcur (mp, mp->hghsel);  /* update current message */
        seq_save (mp);                    /* synchronize sequences  */
        context_save ();                  /* save the context file  */
     }
index 3c36871..0b4e439 100644 (file)
@@ -159,8 +159,11 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug)
     char *cp, buffer[BUFSIZ];
     CI ci = &ct->c_ctinfo;
 
-    printf (toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : "     ",
-           atoi (r1bindex (empty (ct->c_file), '/')));
+    if (toplevel > 0)
+       printf (LSTFMT2a, atoi (r1bindex (empty (ct->c_file), '/')));
+    else
+       printf(toplevel < 0 ? "part " : "     ");
+
     snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type),
                empty (ci->ci_subtype));
     printf (LSTFMT2b, empty (ct->c_partno), buffer);
index af280f5..76bb37d 100644 (file)
@@ -285,7 +285,10 @@ checkmail (char *user, char *home, int datesw, int notifysw, int personal)
 
     if ((mf & UUCPOK) || (mf & MMDFOK)) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
            if (mf & UUCPOK)
                printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new");
            if ((mf & UUCPOK) && (mf & MMDFOK))
@@ -340,7 +343,11 @@ remotemail (char *host, char *port, char *user, char *proxy, int notifysw,
 
     if (nmsgs) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
+
            printf ("%d message%s (%d bytes)",
                    nmsgs, nmsgs != 1 ? "s" : "", nbytes);
        }
index cfec7b9..679ae6d 100644 (file)
@@ -648,9 +648,13 @@ main (int argc, char **argv)
     p_refile (tmpfil);
     unlink (tmpfil);
 
-    if (verbose)
-       printf (partno ? "Partial Message #%s Processed\n" : "Message Processed\n",
-               partno);
+    if (verbose) {
+       if (partno)
+           printf ("Partial Message #%s Processed\n", partno);
+       else
+           printf ("Message Processed\n");
+    }
+
     done (0);
     return 1;
 }
index 3557c9e..ee404ef 100644 (file)
@@ -434,6 +434,8 @@ replfilter (FILE *in, FILE *out, char *filter, int fmtproc)
     rewind (in);
     lseek (fileno(in), (off_t) 0, SEEK_SET);
 
+    arglist = argsplit(mhlproc, &mhl, &argnum);
+
     switch (pid = fork()) {
        case NOTOK: 
            adios ("fork", "unable to");
@@ -448,7 +450,6 @@ replfilter (FILE *in, FILE *out, char *filter, int fmtproc)
             * because we never call arglist_free().  But if we ever change
             * that be sure to use getcpy() for the extra arguments.
             */
-           arglist = argsplit(mhlproc, &mhl, &argnum);
            arglist[argnum++] = "-form";
            arglist[argnum++] = filter;
            arglist[argnum++] = "-noclear";
index c038622..a07889e 100644 (file)
@@ -277,10 +277,12 @@ body:;
 
            case LENERR: 
            case FMTERR: 
-               fprintf (stderr, 
-                       innum ? "??Format error (message %d) in "
-                             : "??Format error in ",
-                       outnum ? outnum : innum);
+               if (innum)
+                   fprintf (stderr, "??Format error (message %d) in ",
+                            outnum ? outnum : innum);
+               else
+                   fprintf (stderr, "??Format error in ");
+
                fprintf (stderr, "component %d\n", compnum);
 
                if (outnum) {