mirror of
https://github.com/mirror/wget.git
synced 2024-12-29 14:30:48 +08:00
Reopen stdout in binary mode for -O -.
This commit is contained in:
parent
b4077ab56a
commit
de86fc8c82
@ -1,3 +1,8 @@
|
||||
2008-06-01 Micah Cowan <micah@cowan.name>
|
||||
|
||||
* main.c [WINDOWS]: Reopen stdout in binary mode, when -O - is
|
||||
given.
|
||||
|
||||
2008-05-31 Micah Cowan <micah@cowan.name>
|
||||
|
||||
* html-url.c, http.c: Avoid casts in a couple spots.
|
||||
|
14
src/main.c
14
src/main.c
@ -991,7 +991,19 @@ for details.\n\n"));
|
||||
if (opt.output_document)
|
||||
{
|
||||
if (HYPHENP (opt.output_document))
|
||||
output_stream = stdout;
|
||||
{
|
||||
#ifdef WINDOWS
|
||||
FILE *result;
|
||||
result = freopen (NULL, "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
|
||||
output_stream = stdout;
|
||||
}
|
||||
else
|
||||
{
|
||||
struct_fstat st;
|
||||
|
Loading…
Reference in New Issue
Block a user