Use good m_ functions, because it smell like a flower, version 2.
[apps/madmutt.git] / commands.c
index 85ff46a..4a40dc9 100644 (file)
@@ -69,7 +69,7 @@ int mutt_display_message (HEADER * cur)
                                        -1, fileno (fpfilterout), -1);
     if (filterpid < 0) {
       mutt_error (_("Cannot create display filter"));
-      safe_fclose (&fpfilterout);
+      m_fclose(&fpfilterout);
       unlink (tempfile);
       return 0;
     }
@@ -128,28 +128,18 @@ int mutt_display_message (HEADER * cur)
     mx_close_message (&msg);
   }
 
-  if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res == -1) {
+  if ((m_fclose(&fpout) != 0 && errno != EPIPE) || res == -1) {
     mutt_error (_("Could not copy message"));
     if (fpfilterout != NULL) {
       mutt_wait_filter (filterpid);
-      safe_fclose (&fpfilterout);
+      m_fclose(&fpfilterout);
     }
-#if 0
-    /* this is maybe just plain wrong but it makes the pager display
-     * what we have; i.e. for the crypto stuff we only get
-     * 'Could not copy message' for invalid passphrases, no PGP output
-     * not nothing; so just display what we have...
-     * - pdmef
-     */
-    mutt_unlink (tempfile);
-    return 0;
-#endif
   }
 
   if (fpfilterout != NULL && mutt_wait_filter (filterpid) != 0)
     mutt_any_key_to_continue (NULL);
 
-  safe_fclose (&fpfilterout);   /* XXX - check result? */
+  m_fclose(&fpfilterout);   /* XXX - check result? */
 
 
   /* update crypto information for this message */
@@ -356,7 +346,7 @@ static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
     }
 
     pipe_msg (h, fpout, decode, print);
-    fclose (fpout);
+    m_fclose(&fpout);
     rc = mutt_wait_filter (thepid);
   }
   else {                        /* handle tagged messages */
@@ -389,7 +379,7 @@ static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
           /* add the message separator */
           if (sep)
             fputs (sep, fpout);
-          safe_fclose (&fpout);
+          m_fclose(&fpout);
           if (mutt_wait_filter (thepid) != 0)
             rc = 1;
         }
@@ -412,7 +402,7 @@ static int _mutt_pipe_message(HEADER * h, char *cmd, int decode, int print,
             fputs (sep, fpout);
         }
       }
-      safe_fclose (&fpout);
+      m_fclose(&fpout);
       if (mutt_wait_filter (thepid) != 0)
         rc = 1;
     }
@@ -441,7 +431,7 @@ void mutt_pipe_message (HEADER * h)
 void mutt_print_message (HEADER * h)
 {
 
-  if (quadoption (OPT_PRINT) && (!PrintCmd || !*PrintCmd)) {
+  if (quadoption (OPT_PRINT) && m_strisempty(PrintCmd)) {
     mutt_message (_("No printing command has been defined."));
     return;
   }