1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Set stdout mode to binary under Windows.

This commit is contained in:
Adrien Nader 2011-05-23 21:56:44 +02:00 committed by Giuseppe Scrivano
parent 3fb4d068a7
commit d7991738d6
2 changed files with 13 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2010-12-28 Adrien Nader <adrien@notk.org> (tiny change)
* main.c [WINDOWS]: Include <io.h> and <fcntl.h>.
(main) [WINDOWS]: Set the stdout file mode to binary.
Submitted also by: Martin Panter <vadmium@gmail.com>
2011-05-23 Giuseppe Scrivano <gscrivano@gnu.org> 2011-05-23 Giuseppe Scrivano <gscrivano@gnu.org>
* retr.c (fd_read_body): Be sure the buffer size is at least 8Kb. * retr.c (fd_read_body): Be sure the buffer size is at least 8Kb.

View File

@ -60,6 +60,11 @@ as that of the covered work. */
#include <getpass.h> #include <getpass.h>
#include <quote.h> #include <quote.h>
#ifdef WINDOWS
# include <io.h>
# include <fcntl.h>
#endif
#ifdef __VMS #ifdef __VMS
# include "vms.h" # include "vms.h"
#endif /* __VMS */ #endif /* __VMS */
@ -1249,14 +1254,7 @@ for details.\n\n"));
if (HYPHENP (opt.output_document)) if (HYPHENP (opt.output_document))
{ {
#ifdef WINDOWS #ifdef WINDOWS
FILE *result; _setmode (_fileno (stdout), _O_BINARY);
result = freopen ("CONOUT$", "wb", stdout);
if (result == NULL)
{
logputs (LOG_NOTQUIET, _("\
WARNING: Can't reopen standard output in binary mode;\n\
downloaded file may contain inappropriate line endings.\n"));
}
#endif #endif
output_stream = stdout; output_stream = stdout;
} }