]> sjero.net Git - wget/blobdiff - src/retr.c
[svn] --delete-after wasn't implemented for files retrieved by FTP or corresponding to
[wget] / src / retr.c
index d90fa5296fa8a48e90d7c61ad47af7d3b38452c9..7e884f1b3cb4bef1e48b35e04124159b664cf867 100644 (file)
@@ -323,7 +323,12 @@ retrieve_url (const char *origurl, char **file, char **newloc,
   if (refurl)
     u->referer = xstrdup (refurl);
   else
-    u->referer = NULL;
+    {
+      if (opt.referer)
+       u->referer = xstrdup (opt.referer);
+      else
+       u->referer = NULL;
+    }
 
   local_use_proxy = USE_PROXY_P (u);
   if (local_use_proxy)
@@ -425,9 +430,9 @@ retrieve_url (const char *origurl, char **file, char **newloc,
   return result;
 }
 
-/* Find the URL-s in the file and call retrieve_url() for each of
+/* Find the URLs in the file and call retrieve_url() for each of
    them.  If HTML is non-zero, treat the file as HTML, and construct
-   the URL-s accordingly.
+   the URLs accordingly.
 
    If opt.recursive is set, call recursive_retrieve() for each file.  */
 uerr_t
@@ -438,7 +443,7 @@ retrieve_from_file (const char *file, int html, int *count)
 
   /* If spider-mode is on, we do not want get_urls_html barfing
      errors on baseless links.  */
-  url_list = (html ? get_urls_html (file, NULL, opt.spider)
+  url_list = (html ? get_urls_html (file, NULL, opt.spider, FALSE)
              : get_urls_file (file));
   status = RETROK;             /* Suppose everything is OK.  */
   *count = 0;                  /* Reset the URL count.  */
@@ -460,6 +465,8 @@ retrieve_from_file (const char *file, int html, int *count)
 
       if (filename && opt.delete_after && file_exists_p (filename))
        {
+         DEBUGP (("Removing file due to --delete-after in"
+                  " retrieve_from_file():\n"));
          logprintf (LOG_VERBOSE, _("Removing %s.\n"), filename);
          if (unlink (filename))
            logprintf (LOG_NOTQUIET, "unlink: %s\n", strerror (errno));