]> diplodocus.org Git - nmh/commitdiff
Replaced use of m_mktemp() with m_mktemp2() so that tmp files created
authorDavid Levine <levinedl@acm.org>
Tue, 21 Jan 2014 03:08:47 +0000 (21:08 -0600)
committerDavid Levine <levinedl@acm.org>
Tue, 21 Jan 2014 03:08:47 +0000 (21:08 -0600)
by attach, burst, mhbuild, and post will be in the directory specified
by the first non-null of {MHTMPDIR, TMPDIR, TMP, MH Path directory}.

uip/attach.c
uip/burst.c
uip/mhbuild.c
uip/post.c

index 2902499706ab536aac55a3b8f76daa808c6ea9bb..e19a0eba0a20d50be72a78278f0303ca1628ed3c 100644 (file)
@@ -101,10 +101,10 @@ attach(char *attachment_header_field_name, char *draft_file_name,
      */
 
     (void)strncpy(body_file_name,
-                  m_mktemp(m_maildir(invo_name), NULL, NULL),
+                  m_mktemp2(NULL, invo_name, NULL, NULL),
                   body_file_name_len);
     (void)strncpy(composition_file_name,
-                  m_mktemp(m_maildir(invo_name), NULL, NULL),
+                  m_mktemp2(NULL, invo_name, NULL, NULL),
                   composition_file_name_len);
 
     if (has_body)
index 34ef10b024d6e883b3fc6473ad27a49e14e85e1f..9b893cfea3b68fa10ddf32d94e7bc1c0a28bfc93 100644 (file)
@@ -465,7 +465,7 @@ burst (struct msgs **mpp, int msgnum, struct smsg *smsgs, int numburst,
     i = inplace ? msgnum + numburst : mp->hghmsg;
     for (j = numburst; j >= (inplace ? 0 : 1); i--, j--) {
        strncpy (f1, m_name (i), sizeof(f1));
-       strncpy (f2, m_mktemp(invo_name, NULL, &out), sizeof(f2));
+       strncpy (f2, m_mktemp2(NULL, invo_name, NULL, &out), sizeof(f2));
 
        if (verbosw && i != msgnum)
            printf ("message %d of digest %d becomes message %d\n", j, msgnum, i);
index 5d527f5c993ddf0ecd4c32e3447a7c69c0bb7a04..624cf4b9707a28c15f147e6b607e9b2f1dd06855 100644 (file)
@@ -316,7 +316,7 @@ main (int argc, char **argv)
      */
     if (compfile[0] == '-' && compfile[1] == '\0') {
        /* copy standard input to temporary file */
-       strncpy (infile, m_mktemp(invo_name, NULL, &fp), sizeof(infile));
+       strncpy (infile, m_mktemp2(NULL, invo_name, NULL, &fp), sizeof(infile));
        while (fgets (buffer, BUFSIZ, stdin))
            fputs (buffer, fp);
        fclose (fp);
index 858946354ba2e55a5ec7e0c2242cf1720e3e519e..9483dbf6b3b84cac4062083b4bdd4c731cac58a7 100644 (file)
@@ -535,12 +535,9 @@ main (int argc, char **argv)
            if ((out = fopen ("/dev/null", "w")) == NULL)
                adios ("/dev/null", "unable to open");
        } else {
-            char *cp = m_mktemp(m_maildir(invo_name), NULL, &out);
+            char *cp = m_mktemp2(NULL, invo_name, NULL, &out);
             if (cp == NULL) {
-                cp = m_mktemp2(NULL, invo_name, NULL, &out);
-                if (cp == NULL) {
-                   adios ("post", "unable to create temporary file");
-                }
+                adios ("post", "unable to create temporary file");
             }
             strncpy(tmpfil, cp, sizeof(tmpfil));
            chmod (tmpfil, 0600);