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:
parent
3fb4d068a7
commit
d7991738d6
@ -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>
|
||||
|
||||
* retr.c (fd_read_body): Be sure the buffer size is at least 8Kb.
|
||||
|
16
src/main.c
16
src/main.c
@ -60,8 +60,13 @@ as that of the covered work. */
|
||||
#include <getpass.h>
|
||||
#include <quote.h>
|
||||
|
||||
#ifdef WINDOWS
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VMS
|
||||
#include "vms.h"
|
||||
# include "vms.h"
|
||||
#endif /* __VMS */
|
||||
|
||||
#ifndef PATH_SEPARATOR
|
||||
@ -1249,14 +1254,7 @@ for details.\n\n"));
|
||||
if (HYPHENP (opt.output_document))
|
||||
{
|
||||
#ifdef WINDOWS
|
||||
FILE *result;
|
||||
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"));
|
||||
}
|
||||
_setmode (_fileno (stdout), _O_BINARY);
|
||||
#endif
|
||||
output_stream = stdout;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user