]> sjero.net Git - wget/blobdiff - src/spider.c
[svn] Fix #20811: Assertion failure with --spider --recursive.
[wget] / src / spider.c
index d8cf83619d9b349f9c925cd71695abdf582f31fb..b0bda64c0e6551ee21332678cac0938a446a61c4 100644 (file)
@@ -5,7 +5,7 @@ This file is part of GNU Wget.
 
 GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
 
 GNU Wget is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+along with Wget.  If not, see <http://www.gnu.org/licenses/>.
 
 In addition, as a special exception, the Free Software Foundation
 gives permission to link the code of its release of Wget with the
@@ -68,14 +67,14 @@ struct url_list
 };
 
 static bool
-in_url_list_p (const struct url_list *list, const char *url, bool verbose)
+in_url_list_p (const struct url_list *list, const char *url)
 {
   const struct url_list *ptr;
   
   for (ptr = list; ptr; ptr = ptr->next)
     {
       /* str[case]cmp is inadequate for URL comparison */
-      if (are_urls_equal (url, ptr->url)) 
+      if (ptr->url != NULL && are_urls_equal (url, ptr->url)) 
         return true;
     }
  
@@ -101,7 +100,7 @@ visited_url (const char *url, const char *referrer)
       list->url = referrer ? xstrdup (referrer) : NULL;
       hash_table_put (visited_urls_hash, xstrdup (url), list);
     }
-  else if (referrer && !in_url_list_p (list, referrer, false)) 
+  else if (referrer && !in_url_list_p (list, referrer)) 
     {
       /* Append referrer at the end of the list */
       struct url_list *newnode;
@@ -141,16 +140,10 @@ print_broken_links (void)
   
   num_elems = hash_table_count (nonexisting_urls_set);
   assert (num_elems > 0);
-  
-  if (num_elems > 1) 
-    {
-      logprintf (LOG_NOTQUIET, _("Found %d broken links.\n\n"), 
-                 num_elems);
-    }
-  else
-    {
-      logprintf (LOG_NOTQUIET, _("Found 1 broken link.\n\n"));
-    }
+
+  logprintf (LOG_NOTQUIET, ngettext("Found %d broken link.\n\n",
+                                    "Found %d broken links.\n\n", num_elems),
+             num_elems);
   
   for (hash_table_iterate (nonexisting_urls_set, &iter);
        hash_table_iter_next (&iter); )