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)
This commit is contained in:
Daniele Calore 2015-08-16 00:16:12 +05:30 committed by Darshit Shah
parent f71887bbe5
commit 12bae50b28
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}
}