]> sjero.net Git - wget/blobdiff - src/spider.c
[svn] Fix #20811: Assertion failure with --spider --recursive.
[wget] / src / spider.c
index ee094127317f02f17b1b80d0184bdd430c7a2f39..b0bda64c0e6551ee21332678cac0938a446a61c4 100644 (file)
@@ -67,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;
     }
  
@@ -100,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;
@@ -140,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); )