X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fmessage.c;h=6c1fce7590d381107b6712ca49099b99158f39d5;hp=930f4d36a2d02abce173598c85874e7325888406;hb=7b392ef7b50798f9eb3e7c869e634c5fef0092d1;hpb=92f2fc3802e13a8eb0717123c588d855fa0de67f diff --git a/imap/message.c b/imap/message.c index 930f4d3..6c1fce7 100644 --- a/imap/message.c +++ b/imap/message.c @@ -83,13 +83,13 @@ int imap_read_headers (IMAP_DATA * idata, int msgbegin, int msgend) /* instead of downloading all headers and then parsing them, we parse them * as they come in. */ - mutt_mktemp (tempfile); - if (!(fp = safe_fopen (tempfile, "w+"))) { - mutt_error (_("Could not create temporary file %s"), tempfile); - mutt_sleep (2); + fp = m_tempfile(tempfile, sizeof(tempfile), NONULL(Tempdir), NULL); + if (!fp) { + mutt_error(_("Could not create temporary file")); + mutt_sleep(2); return -1; } - unlink (tempfile); + unlink(tempfile); /* make sure context has room to hold the mailbox */ while ((msgend) >= idata->ctx->hdrmax) @@ -376,12 +376,11 @@ int imap_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) mutt_message _("Fetching message..."); cache->uid = HEADER_DATA (h)->uid; - mutt_mktemp (path); - cache->path = m_strdup(path); - if (!(msg->fp = safe_fopen (path, "w+"))) { - p_delete(&cache->path); + msg->fp = m_tempfile(path, sizeof(path), NONULL(Tempdir), NULL); + if (!msg->fp) { return -1; } + cache->path = m_strdup(path); /* mark this header as currently inactive so the command handler won't * also try to update it. HACK until all this code can be moved into the