remove some mutt_mktemp
[apps/madmutt.git] / pattern.c
index 40600b6..c8dff19 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -133,9 +133,9 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno)
       p_clear(&s, 1);
       s.fpin = msg->fp;
       s.flags = M_CHARCONV;
-      mutt_mktemp (tempfile);
-      if ((s.fpout = safe_fopen (tempfile, "w+")) == NULL) {
-        mutt_perror (tempfile);
+      s.fpout = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL);
+      if (!s.fpout) {
+        mutt_error(_("Could not create temporary file"));
         return (0);
       }
 
@@ -1141,7 +1141,7 @@ void mutt_check_simple (char *s, ssize_t len, const char *simple)
       m_strcpy(s, len, "~U");
     else {
       quote_simple (tmp, sizeof (tmp), s);
-      m_snsubst(s, len, simple, tmp);
+      m_file_fmt(s, len, simple, tmp);
     }
   }
 }