1
0
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:
Miquel Llobet 2015-03-15 21:48:27 +01:00 committed by Darshit Shah
parent 12bae50b28
commit e04c5989ff

View File

@ -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