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)
|
if (file)
|
||||||
{
|
{
|
||||||
logfp = fopen (file, appendp ? "a" : "w");
|
if (HYPHENP (file))
|
||||||
if (!logfp)
|
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: %s: %s\n", exec_name, file, strerror (errno));
|
logfp = stdout;
|
||||||
exit (WGET_EXIT_GENERIC_ERROR);
|
}
|
||||||
|
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
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user