Fix empty mailto (-m "") handling: somehow I missed all checks but the first,

hence output would be written to the wrong filehandle.

Submitted by:	reg
Approved by:	yar (implicit)
MFC after:	ASAP
Pointy hat to:	marck
This commit is contained in:
Dmitry Morozovsky 2008-08-01 08:01:33 +00:00
parent c1f84335c4
commit 1168e5f13b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181115

View File

@ -468,13 +468,15 @@ child_process(e, u)
else
mailto = usernm;
}
if (mailto && *mailto == '\0')
mailto = NULL;
/* if we are supposed to be mailing, MAILTO will
* be non-NULL. only in this case should we set
* up the mail command and subjects and stuff...
*/
if (mailto && *mailto != '\0') {
if (mailto) {
register char **env;
auto char mailcmd[MAX_COMMAND];
auto char hostname[MAXHOSTNAMELEN];