]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
Here's a better fix to m_Eom() in m_getfld.c than commit
[nmh] / uip / mhmail
index ffc51298d2c619120eb2048a331f89be9b8ddeb0..b9dc0ddd2eb32c8e2ed6c096a84b9e81f7d9f66e 100755 (executable)
@@ -215,9 +215,11 @@ fi
 #### .orig file, so it will remove them, too.
 umask 077
 tmpdir="${MHTMPDIR:-${TMPDIR:-`$nmhbindir/mhpath +`}}"
-tmpfile="$tmpdir/mhmail$$"
+tmpfilename=`cd "$tmpdir"  &&  "${nmhlibdir}/mkstemp" -p mhmail`
+[ $? -ne 0 ]  &&  die "mhmail: failed to create temporary file in $tmpdir"
+tmpfile="$tmpdir/$tmpfilename"
 backup_char=`"$nmhbindir"/mhparam sbackup`
-tmpfilebackup="'$tmpdir'/${backup_char}mhmail$$*"
+tmpfilebackup="$tmpdir/${backup_char}${tmpfilename}*"
 tmpfileresent=
 
 message_file=
@@ -234,7 +236,8 @@ else
     #### When resending with send, tmpfile will just contain the
     #### Resent- header fields.  "$tmpfileresent" will contain
     #### the message that is being resent.
-    tmpfileresent="$tmpdir/mhmail-resent$$"
+    tmpfileresent=`"${nmhlibdir}/mkstemp" -d "$tmpdir" -p mhmail-resent`
+    [ $? -ne 0 ]  &&  die "mhmail: failed to create temporary file in $tmpdir"
     mhdist=1; export mhdist
     mhaltmsg=$tmpfileresent; export mhaltmsg
     message_file="$tmpfileresent"