mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fixed #44516 -o- not logging to stdout
src/log.c (log_init): check for hypen on filename, set stdout
This commit is contained in:
parent
12bae50b28
commit
e04c5989ff
15
src/log.c
15
src/log.c
@ -598,11 +598,18 @@ log_init (const char *file, bool appendp)
|
||||
{
|
||||
if (file)
|
||||
{
|
||||
logfp = fopen (file, appendp ? "a" : "w");
|
||||
if (!logfp)
|
||||
if (HYPHENP (file))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: %s\n", exec_name, file, strerror (errno));
|
||||
exit (WGET_EXIT_GENERIC_ERROR);
|
||||
logfp = stdout;
|
||||
}
|
||||
else
|
||||
{
|
||||
logfp = fopen (file, appendp ? "a" : "w");
|
||||
if (!logfp)
|
||||
{
|
||||
fprintf (stderr, "%s: %s: %s\n", exec_name, file, strerror (errno));
|
||||
exit (WGET_EXIT_GENERIC_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user