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);
}
{
mx_close_message (&msg);
if (fp) {
- fclose (fp);
+ m_fclose(&fp);
unlink (tempfile);
}
return (0);
mx_close_message (&msg);
if (option (OPTTHOROUGHSRC)) {
- fclose (fp);
+ m_fclose(&fp);
unlink (tempfile);
}
}
return (-1);
}
-#if 0
- /* If there are no RE metacharacters, use simple search anyway */
- if (!pat->stringmatch && !strpbrk (buf.data, "|[{.*+?^$"))
- pat->stringmatch = 1;
-#endif
-
if (pat->stringmatch) {
pat->str = m_strdup(buf.data);
p_delete(&buf.data);