]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
Cast argument to isspace() to unsigned char instead of int.
[nmh] / uip / mhmail
index a0baf2e9efd5855cfd9efa68f2fbd7a97322eb6c..92bf2dbb832f5a65499a0f461f0b76837d974e80 100755 (executable)
@@ -204,15 +204,18 @@ if [ "$headerfieldlist" ]; then
   header="$header$headerfieldlist"
 fi
 
-#### Set up a file to supply as a draft to post/send.  And set a
-#### trap to remove it.  send moves the file to a backup, so it will
-#### remove that, too.
+#### Set up a file to supply as a draft to post/send.  And set a trap
+#### to remove it.  send moves the file to a backup and can create a
+#### .orig file, so it will remove them, too.
 umask 077
-tmpdir="${MHTMPDIR:-${TMPDIR:-${TMP:-`$nmhbindir/mhpath +`}}}"
+tmpdir="${MHTMPDIR:-${TMPDIR:-`$nmhbindir/mhpath +`}}"
 tmpfile="$tmpdir/mhmail$$"
-tmpfilebackup="'$tmpdir'/,mhmail$$ '$tmpdir'/#mhmail$$"
+backup_char=`"$nmhbindir"/mhparam sbackup`
+tmpfilebackup="'$tmpdir'/${backup_char}mhmail$$*"
 tmpfileresent=
 
+trap "rm -f '$tmpfile' $tmpfilebackup ${tmpfileresent:+'$tmpfileresent'}" 0
+
 message_file=
 if [ $resent -eq 0 ]; then
   #### Add blank line after header if not resending.
@@ -235,8 +238,6 @@ else
   fi
 fi
 
-trap "rm -f '$tmpfile' $tmpfilebackup ${tmpfileresent:+'$tmpfileresent'}" 0
-
 if [ "$body"x = x ]; then
   #### First put message header in the file.
   printf %s "$header" >"$tmpfile" || exit 2