mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
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@gnupg.org>
This commit is contained in:
parent
dd60e868d2
commit
5c83759364
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user