From: hniksic Date: Mon, 15 Apr 2002 21:57:10 +0000 (-0700) Subject: [svn] When downloading recursively, don't ignore rejection of HTML X-Git-Tag: v1.13~1784 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=f8b4b8bd12b0f5c76b7eb6ed908e3cfe0cdc0843 [svn] When downloading recursively, don't ignore rejection of HTML documents that are themselves leaves of recursion. --- diff --git a/src/ChangeLog b/src/ChangeLog index a17ffe8e..d9dd76bd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2002-04-15 Hrvoje Niksic + + * recur.c (download_child_p): Don't ignore rejection of HTML + documents that are themselves leaves of recursion. + 2002-04-15 Ian Abbott Makefile.in: Updated several dependencies for object files to take @@ -16,6 +21,7 @@ * utils.c: Don't define `SETJMP()', `run_with_timeout_env' or `abort_run_with_timeout()' when `USE_SIGNAL_TIMEOUT' is undefined. +>>>>>>> 1.395 2002-04-15 Hrvoje Niksic * host.c (getaddrinfo_with_timeout): New function. diff --git a/src/recur.c b/src/recur.c index 1d6a6988..da277415 100644 --- a/src/recur.c +++ b/src/recur.c @@ -511,23 +511,13 @@ download_child_p (const struct urlpos *upos, struct url *parent, int depth, /* 6. */ { /* Check for acceptance/rejection rules. We ignore these rules - for HTML documents because they might lead to other files which - need to be downloaded. Of course, we don't know which - documents are HTML before downloading them, so we guess. - - A file is subject to acceptance/rejection rules if: - - * u->file is not "" (i.e. it is not a directory) - and either: - + there is no file suffix, - + or there is a suffix, but is not "html" or "htm" or similar, - + both: - - recursion is not infinite, - - and we are at its very end. */ - + for directories (no file name to match) and for HTML documents, + which might lead to other files that do need to be downloaded. + That is, unless we've exhausted the recursion depth anyway. */ if (u->file[0] != '\0' - && (!has_html_suffix_p (url) - || (opt.reclevel != INFINITE_RECURSION && depth >= opt.reclevel))) + && !(has_html_suffix_p (u->file) + && depth < opt.reclevel - 1 + && depth != INFINITE_RECURSION)) { if (!acceptable (u->file)) {