** char *tmp_pathname = m_mktemp2(NULL, "mypre", ...);
*/
char *
-m_mktemp (
+m_mktemp(
const char *pfx_in, /* Pathname prefix for temporary file. */
int *fd_ret, /* (return,opt.) File descriptor to temp file. */
FILE **fp_ret /* (return,opt.) FILE pointer to temp file. */
** above) is used to create the temp file.
*/
char *
-m_mktemp2 (
+m_mktemp2(
const char *dir_in, /* Directory to place temp file. */
const char *pfx_in, /* Basename prefix for temp file. */
int *fd_ret, /* (return,opt.) File descriptor to temp file. */
return m_mktemp(buffer, fd_ret, fp_ret);
}
- if ((cp = r1bindex ((char *)dir_in, '/')) == dir_in) {
+ if ((cp = mhbasename((char *)dir_in)) == dir_in) {
/* No directory component */
return m_mktemp(pfx_in, fd_ret, fp_ret);
}
n = (int)(cp-dir_in-1); /* Length of dir component */
- snprintf(buffer, sizeof(buffer), "%.*s%s", n, dir_in, pfx_in);
+ snprintf(buffer, sizeof(buffer), "%.*s/%s", n, dir_in, pfx_in);
return m_mktemp(buffer, fd_ret, fp_ret);
}
tmpdir = getenv("TMP");
if (tmpdir != NULL && *tmpdir != '\0') return tmpdir;
}
- return m_maildir("");
+ return toabsdir("+");
}