projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7bd4d02
)
Support empty message body in mhmail.in the same way as in mhmail.
author
David Levine
<levinedl@acm.org>
Thu, 14 Jun 2012 04:12:22 +0000
(23:12 -0500)
committer
David Levine
<levinedl@acm.org>
Thu, 14 Jun 2012 04:12:22 +0000
(23:12 -0500)
uip/mhmail.in
patch
|
blob
|
history
diff --git
a/uip/mhmail.in
b/uip/mhmail.in
index
2caea10
..
56bcac0
100755
(executable)
--- a/
uip/mhmail.in
+++ b/
uip/mhmail.in
@@
-84,6
+84,9
@@
else
cclist="${cclist:+${cclist}, }${arg}"; ccarg=0
elif [ ${bodyarg} -eq 1 ]; then
body=${arg}; bodyarg=0
cclist="${cclist:+${cclist}, }${arg}"; ccarg=0
elif [ ${bodyarg} -eq 1 ]; then
body=${arg}; bodyarg=0
+ #### Allow -body "" by using just a newline for the body.
+ [ "${body}"x = x ] && body="
+"
elif [ ${otherarg} -eq 1 ]; then
#### Always end ${header} with a newline.
header="${header:+${header} }${arg}
elif [ ${otherarg} -eq 1 ]; then
#### Always end ${header} with a newline.
header="${header:+${header} }${arg}
@@
-109,9
+112,9
@@
else
fi
#### If no -body, read message from stdin the easy way.
fi
#### If no -body, read message from stdin the easy way.
- if [ "${body}"x = x ]; then
- body=`cat`
- fi
+ [ "${body}"x = x ] && body=`cat`
+ #### Don't allow an empty body (from stdin).
+ [ "${body}"x = x ] && exit 1
#### Set up a tmpfil and trap to remove it. send moves the file to a backup.
tmpdir=${MHTMPDIR:-${TMPDIR:-${TMP:-`${nmhbindir}/mhpath +`}}}
#### Set up a tmpfil and trap to remove it. send moves the file to a backup.
tmpdir=${MHTMPDIR:-${TMPDIR:-${TMP:-`${nmhbindir}/mhpath +`}}}