bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] [Patch] fix bug #44516, -o- log to stdout


From: Miquel Llobet
Subject: [Bug-wget] [Patch] fix bug #44516, -o- log to stdout
Date: Fri, 13 Mar 2015 02:04:02 +0100

wget now correctly reads that -o- means logging to stdout instead of the
file '-'.
I just checked for a hyphen at log_init, didn't see any caveats to this.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]