[git] GnuPG - branch, master, updated. gnupg-2.1.19-44-g5c83759

by Werner Koch cvs at cvs.gnupg.org
Wed Mar 8 17:29:18 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  5c83759364272b19ceafbef46d057f0430a12698 (commit)
      from  dd60e868d2bf649a33dc96e207ffd3b8ae4d35af (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5c83759364272b19ceafbef46d057f0430a12698
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Mar 8 17:23:31 2017 +0100

    wks: Put stdout into binary mode for Windows.
    
    * tools/send-mail.c (send_mail_to_file): Call es_set_binary.
    --
    
    Without that, output to stdout via --send is mangled: The "\r\n" is
    translated to "\r\r\n" which is bad because other
    software (e.g. Thunderbird) translates this again to "\n\n" and thus
    put all mail header liens after the first into the body.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tools/send-mail.c b/tools/send-mail.c
index 34d47c1..fb1a9d0 100644
--- a/tools/send-mail.c
+++ b/tools/send-mail.c
@@ -71,13 +71,23 @@ send_mail_to_file (estream_t fp, const char *fname)
   if (!buffer)
     return gpg_error_from_syserror ();
 
-  outfp = !strcmp (fname,"-")? es_stdout : es_fopen (fname, "wb");
-  if (!outfp)
+
+  if (!strcmp (fname,"-"))
     {
-      err = gpg_error_from_syserror ();
-      log_error ("error creating '%s': %s\n", fname, gpg_strerror (err));
-      goto leave;
+      outfp = es_stdout;
+      es_set_binary (es_stdout);
     }
+  else
+    {
+      outfp = es_fopen (fname, "wb");
+      if (!outfp)
+        {
+          err = gpg_error_from_syserror ();
+          log_error ("error creating '%s': %s\n", fname, gpg_strerror (err));
+          goto leave;
+        }
+    }
+
   for (;;)
     {
       if (es_read (fp, buffer, sizeof buffer, &nbytes))

-----------------------------------------------------------------------

Summary of changes:
 tools/send-mail.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list