Re: Just annooyng Bug...

Hrvoje Niksic <[email protected]>
Newsgroups gmane.comp.web.wget.patches
Message-ID <[email protected]>
I'm about to apply this version of the patch.  Please let me know if
it looks good to you:

2005-04-09  Hrvoje Niksic  <[email protected]>

	* recur.c (download_child_p): When -p is used, (temporarily)
	ignore accept/reject rules for HTMLs, even when they are at the
	maximum recursion depth.  That is because with -p we are, if
	necessary, overstepping the max. depth to get the requisites.

2004-06-12  Larry Jones <lawrence.jones <at> ugsplm.com>

	* recur.c (download_child_p): Correct the logic in check number 6:
	test opt.reclevel (not DEPTH) against INFINITE_RECURSION.

Index: src/recur.c
===================================================================
RCS file: /pack/anoncvs/wget/src/recur.c,v
retrieving revision 1.58
diff -u -r1.58 recur.c
--- src/recur.c	2003/11/02 19:56:37	1.58
+++ src/recur.c	2005/04/09 21:03:17
@@ -516,13 +516,21 @@
     }
 
   /* 6. Check for acceptance/rejection rules.  We ignore these rules
-     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.  */
+     for directories (no file name to match) and for non-leaf HTMLs,
+     which can lead to other files that do need to be downloaded.  (-p
+     automatically implies non-leaf because with -p we can, if
+     necesary, overstep the maximum depth to get the page requisites.)  */
   if (u->file[0] != '\0'
       && !(has_html_suffix_p (u->file)
-	   && depth != INFINITE_RECURSION
-	   && depth < opt.reclevel - 1))
+	   /* The exception only applies to non-leaf HTMLs (but -p
+	      always implies non-leaf because we can overstep the
+	      maximum depth to get the requisites): */
+	   && (/* non-leaf */
+	       opt.reclevel == INFINITE_RECURSION
+	       /* also non-leaf */
+	       || depth < opt.reclevel - 1
+	       /* -p, which implies non-leaf (see above) */
+	       || opt.page_requisites)))
     {
       if (!acceptable (u->file))
 	{
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.