From 1b2496b7f0909376dfeda0eaf90f33ee0f725a14 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 12 Jan 2016 16:04:24 +0100 Subject: [PATCH] Better EMAIL.message computing. Send end of input file for stdin mode. --- .../notification_email/notification_email.e | 21 ++++++++++++------- .../notification_external_mailer.e | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/library/runtime/process/notification_email/notification_email.e b/library/runtime/process/notification_email/notification_email.e index cfe8beb3..16382f4b 100644 --- a/library/runtime/process/notification_email/notification_email.e +++ b/library/runtime/process/notification_email/notification_email.e @@ -1,10 +1,9 @@ note description : "[ - Component representing an email + Email message handled by notification mailer. ]" - author : "$Author: jfiat $" - date : "$Date: 2015-06-30 11:07:17 +0200 (mar., 30 juin 2015) $" - revision : "$Revision: 97586 $" + date: "$Date$" + revision: "$Revision$" class NOTIFICATION_EMAIL @@ -193,12 +192,20 @@ feature -- Reset feature -- Conversion message: STRING_8 + local + l_content: like content do Result := header Result.append_character ('%N') - Result.append (content) - Result.append_character ('%N') - Result.append_character ('%N') + l_content := content + if l_content.is_empty then + Result.append_character ('%N') + else + Result.append (l_content) + if l_content[l_content.count] /= '%N' then + Result.append_character ('%N') + end + end end header: STRING_8 diff --git a/library/runtime/process/notification_email/notification_external_mailer.e b/library/runtime/process/notification_email/notification_external_mailer.e index 41f106f1..c07880a1 100644 --- a/library/runtime/process/notification_email/notification_external_mailer.e +++ b/library/runtime/process/notification_email/notification_external_mailer.e @@ -3,7 +3,6 @@ note Component responsible to send email using an external mailer i.e: an external tool such as sendmail or a script, ... ]" - author: "$Author$" date: "$Date$" revision: "$Revision$" @@ -103,6 +102,7 @@ feature -- Basic operation if attached stdin_termination_sequence as v then p.put_string (v) end + p.put_string ("%N") -- End Of Input file. end else if attached arguments as l_args then