From 12bae50b28fa20f9ffa3d5b0e88f4ebf51fa6864 Mon Sep 17 00:00:00 2001 From: Daniele Calore Date: Sun, 16 Aug 2015 00:16:12 +0530 Subject: [PATCH] Fix #40426: Allow -r -O- only if FILE is regular * main.c: added check of "-r -O FILE" option combination allow only if FILE is a regular file (bug #40426) --- src/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 61accfe0..7134a2f1 100644 --- a/src/main.c +++ b/src/main.c @@ -1726,11 +1726,10 @@ for details.\n\n")); if (fstat (fileno (output_stream), &st) == 0 && S_ISREG (st.st_mode)) output_stream_regular = true; } - if (!output_stream_regular && opt.convert_links) + if (!output_stream_regular && (opt.convert_links || opt.recursive)) { - fprintf (stderr, _("-k can be used together with -O only if \ + fprintf (stderr, _("-k or -r can be used together with -O only if \ outputting to a regular file.\n")); - print_usage (1); exit (WGET_EXIT_GENERIC_ERROR); } }