diff options
author | marck <marck@FreeBSD.org> | 2008-08-01 08:01:33 +0000 |
---|---|---|
committer | marck <marck@FreeBSD.org> | 2008-08-01 08:01:33 +0000 |
commit | fb63e4aaabee40edc99be40c8c92f783574093e7 (patch) | |
tree | 5a6913213d2c549e80228e3b726ed9d35d744ca5 /usr.sbin | |
parent | 6f04a5d9f382971fbf97ac4c2c685ad6b4bbb0b9 (diff) | |
download | FreeBSD-src-fb63e4aaabee40edc99be40c8c92f783574093e7.zip FreeBSD-src-fb63e4aaabee40edc99be40c8c92f783574093e7.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cron/cron/do_command.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index f5ab5b5..daf695f 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -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]; |