From: Ken Hornstein Date: Wed, 4 Dec 2013 02:52:30 +0000 (-0500) Subject: Merge branch 'encode-rfc2047' X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6ba5b855ebc737cc46cabfbe799b0c7706f437f4?hp=4fcf75e40c7c445476029e31c9c93b6c66d23bdc Merge branch 'encode-rfc2047' --- diff --git a/Makefile.am b/Makefile.am index 19519569..a056b24b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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' >> $@ diff --git a/configure.ac b/configure.ac index fac9b91b..38e2a58b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -------------- diff --git a/docs/contrib/build_nmh b/docs/contrib/build_nmh index ef399f86..adc6e1cb 100755 --- a/docs/contrib/build_nmh +++ b/docs/contrib/build_nmh @@ -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 diff --git a/docs/pending-release-notes b/docs/pending-release-notes index b04f610c..8295c33e 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -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 diff --git a/h/fmt_scan.h b/h/fmt_scan.h index 50b597e1..771d9fba 100644 --- a/h/fmt_scan.h +++ b/h/fmt_scan.h @@ -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; /* diff --git a/h/prototypes.h b/h/prototypes.h index 6db99958..3797fecc 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -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 + * + * 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 *); diff --git a/man/mhfixmsg.man b/man/mhfixmsg.man index fcc6dca7..f45447b4 100644 --- a/man/mhfixmsg.man +++ b/man/mhfixmsg.man @@ -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. diff --git a/man/mhlist.man b/man/mhlist.man index bd8f0802..46b75636 100644 --- a/man/mhlist.man +++ b/man/mhlist.man @@ -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. diff --git a/man/rcvpack.man b/man/rcvpack.man index a3763f1f..fc18abeb 100644 --- a/man/rcvpack.man +++ b/man/rcvpack.man @@ -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 diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index a073e707..e5b20520 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -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) diff --git a/sbr/snprintb.c b/sbr/snprintb.c index 5f3f1243..629da4b7 100644 --- a/sbr/snprintb.c +++ b/sbr/snprintb.c @@ -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; } diff --git a/test/dist/test-dist b/test/dist/test-dist index ca6a70b1..c5182afa 100755 --- a/test/dist/test-dist +++ b/test/dist/test-dist @@ -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" < +From: Test9 To: Some User 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 diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index ac013234..9c2df415 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -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" </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 index 00000000..64c9812b --- /dev/null +++ b/test/mhshow/test-charset @@ -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 < $expected < $actual 2>&1 +check "$expected" "$actual" + +exit $failed diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 5fcef29e..e97ab626 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -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; diff --git a/uip/fmttest.c b/uip/fmttest.c index 858732c0..4794c7bf 100644 --- a/uip/fmttest.c +++ b/uip/fmttest.c @@ -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) diff --git a/uip/inc.c b/uip/inc.c index cd98ddb8..0e527442 100644 --- 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 ? "<> %s -ms %s\n" - : host ? "<> %s -host %s -user %s\n" - : "<> %s\n", - dtimenow (0), from ? from : host, user); + if (from) + fprintf (aud, "<> %s -ms %s\n", dtimenow(0), from); + else { + if (host) + fprintf (aud, "<> %s -host %s -user %s\n", dtimenow(0), + host, user); + else + fprintf (aud, "<> %s\n", dtimenow (0)); + } } /* Get new format string */ diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 829697c7..10e9af51 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -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"); } } diff --git a/uip/mhlist.c b/uip/mhlist.c index c63cf888..f6208ddb 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -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 */ } diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 3c368710..0b4e439f 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -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); diff --git a/uip/msgchk.c b/uip/msgchk.c index af280f59..76bb37d8 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -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); } diff --git a/uip/post.c b/uip/post.c index cfec7b96..679ae6df 100644 --- a/uip/post.c +++ b/uip/post.c @@ -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; } diff --git a/uip/replsbr.c b/uip/replsbr.c index 3557c9ec..ee404efd 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -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"; diff --git a/uip/scansbr.c b/uip/scansbr.c index c038622e..a07889e4 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -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) {