m_strcpy(buf, sizeof(buf), filename);
m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));
m_strcpy(buf, sizeof(buf), filename);
m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));