[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout
From: |
Miquel Llobet |
Subject: |
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout |
Date: |
Sat, 14 Mar 2015 21:40:11 +0100 |
>
> It seems like the correct thing to do. Could you please just use as
> ChangeLog-style like commit message?
Yes! Sorry about that, here is the patch with the new commit message. Let
me know if this is correct.
Fixed #44516 -o- not logging to stdout
src/log.c (log_init): check for hypen on filename, set stdout
--- src/log.c.origin 2015-03-13 01:32:27.000000000 +0100
+++ src/log.c 2015-03-13 01:44:31.000000000 +0100
@@ -598,11 +598,18 @@
{
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
Miquel Llobet
On Sat, Mar 14, 2015 at 1:19 PM, Giuseppe Scrivano <address@hidden>
wrote:
> Miquel Llobet <address@hidden> writes:
>
> > removed braces from the second if statement, as per GNU's coding
> standards
> >
> > --- src/log.c.origin 2015-03-13 01:32:27.000000000 +0100
> > +++ src/log.c 2015-03-13 02:28:25.000000000 +0100
> > @@ -598,11 +598,16 @@
> > {
> > if (file)
> > {
> > - logfp = fopen (file, appendp ? "a" : "w");
> > - if (!logfp)
> > + if (HYPHENP (file))
> > + logfp = stdout;
> > + else
> > {
> > - fprintf (stderr, "%s: %s: %s\n", exec_name, file, strerror
> > (errno));
> > - exit (WGET_EXIT_GENERIC_ERROR);
> > + 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
>
> It seems like the correct thing to do. Could you please just use as
> ChangeLog-style like commit message?
>
> Thanks,
> Giuseppe
>
- [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Miquel Llobet, 2015/03/12
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Miquel Llobet, 2015/03/12
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Giuseppe Scrivano, 2015/03/14
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout,
Miquel Llobet <=
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Giuseppe Scrivano, 2015/03/15
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Miquel Llobet, 2015/03/15
- Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Giuseppe Scrivano, 2015/03/15
Re: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout, Darshit Shah, 2015/03/14