]> diplodocus.org Git - nmh/blobdiff - uip/mhfixmsg.c
Revised expected output with -prefer in test/mhlist/test-mhlist.
[nmh] / uip / mhfixmsg.c
index 34e366ce877799bf03985f646f8ba75d221074b7..438f8a66a7ab03427721c5e961398f080085dde3 100644 (file)
@@ -14,6 +14,7 @@
 #include "../sbr/m_maildir.h"
 #include "../sbr/m_mktemp.h"
 #include "../sbr/mime_type.h"
+#include "mhmisc.h"
 #include "mhfree.h"
 #include "mhoutsbr.h"
 #include "mhshowsbr.h"
@@ -61,16 +62,6 @@ int debugsw; /* Needed by mhparse.c. */
 
 #define quitser pipeser
 
-/* mhparse.c */
-extern int skip_mp_cte_check;                 /* flag to InitMultiPart */
-extern int suppress_bogus_mp_content_warning; /* flag to InitMultiPart */
-extern int bogus_mp_content;                  /* flag from InitMultiPart */
-/* flags to/from parse_header_attrs */
-extern int suppress_extraneous_trailing_semicolon_warning;
-
-/* mhmisc.c */
-void flush_errors (void);
-
 /*
  * static prototypes
  */
@@ -87,8 +78,8 @@ typedef struct fix_transformations {
     char *textcharset;
 } fix_transformations;
 
-int mhfixmsgsbr (CT *, char *, const fix_transformations *, FILE **, char *,
-                 FILE **);
+static int mhfixmsgsbr (CT *, char *, const fix_transformations *,
+    FILE **, char *, FILE **);
 static int fix_boundary (CT *, int *);
 static int copy_input_to_output (const char *, FILE *, const char *, FILE *);
 static int get_multipart_boundary (CT, char **);
@@ -307,12 +298,12 @@ main (int argc, char **argv) {
      * Read the standard profile setup
      */
     if ((fp = fopen (cp = etcpath ("mhn.defaults"), "r"))) {
-        readconfig ((struct node **) 0, fp, cp, 0);
+        readconfig(NULL, fp, cp, 0);
         fclose (fp);
     }
 
-    suppress_bogus_mp_content_warning = skip_mp_cte_check = 1;
-    suppress_extraneous_trailing_semicolon_warning = 1;
+    suppress_bogus_mp_content_warning = skip_mp_cte_check = true;
+    suppress_extraneous_trailing_semicolon_warning = true;
 
     if (! context_find ("path")) {
         free (path ("./", TFOLDER));
@@ -485,7 +476,10 @@ main (int argc, char **argv) {
 
     if (*cts) {
         for (ctp = cts; *ctp; ++ctp) {
-            status += mhfixmsgsbr (ctp, maildir, &fx, &infp, outfile, &outfp);
+            status =
+                mhfixmsgsbr (ctp, maildir, &fx, &infp, outfile, &outfp) == OK
+                ? 0
+                : 1;
             free_content (*ctp);
 
             if (using_stdin) {
@@ -512,7 +506,7 @@ main (int argc, char **argv) {
     free (folder);
     free (arguments);
 
-    done (status);
+    done (status == OK ? 0 : 1);
     return NOTOK;
 }
 
@@ -520,7 +514,7 @@ main (int argc, char **argv) {
 /*
  * Apply transformations to one message.
  */
-int
+static int
 mhfixmsgsbr (CT *ctp, char *maildir, const fix_transformations *fx,
              FILE **infp, char *outfile, FILE **outfp) {
     /* Store input filename in case one of the transformations, i.e.,
@@ -2716,7 +2710,7 @@ write_content (CT ct, const char *input_filename, char *outfile, FILE *outfp,
                     }
                 } else {
                     inform("unable to remove input file %s, "
-                       "not modifying it, continuing...", infile);
+                        "not modifying it, continuing...", infile);
                     (void) m_unlink (outfile);
                     status = NOTOK;
                 }