Hi Miquel,

It's a good patch! I only wanted to ask if we really want to print the usage information in this case?

It seems to be contrary to how all other cases are handled. Also, could you please get the commit message in sync with the GNU ChangeLog style messages? Take a look at the other commit messages in the repository.

On 03/13, Miquel Llobet wrote:
When wget is called with -r or -p it will look for resource tags in the
output file, and since -O- redirects to stdout, the program hangs, waiting
for input. The same happens with pipes or FIFO files.

My proposed solution is to disallow calling wget with '-p' or '-r' and
output redirection to either stdout or a FIFO file.

--- src/main.c.origin 2015-03-13 03:59:39.000000000 +0100
+++ src/main.c 2015-03-13 04:10:59.000000000 +0100
@@ -42,6 +42,7 @@
#include <assert.h>
#include <errno.h>
#include <time.h>
+#include <sys/stat.h>

#include "exits.h"
#include "utils.h"
@@ -1335,6 +1336,18 @@
                         opt.output_document);
              exit (WGET_EXIT_GENERIC_ERROR);
           }
+      if (opt.recursive || opt.page_requisites)
+      {
+        struct stat status;
+        stat (opt.output_document, &status);
+        if (HYPHENP (opt.output_document) || status.st_mode & S_IFIFO)
+          {
+            fprintf (stderr, _("Can't do \
+recursive download with output redirected to stdout, pipe or FIFO
file\n"));
+            print_usage (1);
+            exit (WGET_EXIT_GENERIC_ERROR);
+          }
+      }
    }

  if (opt.warc_filename != 0)


Miquel Llobet
--- end quoted text ---

--
Thanking You,
Darshit Shah

Attachment: pgpwEWhuSr1sj.pgp
Description: PGP signature

Reply via email to