]> sjero.net Git - wget/commitdiff
-i accepts URLs (stsc). For #21265.
authorMicah Cowan <micah@cowan.name>
Sat, 12 Jul 2008 00:16:49 +0000 (17:16 -0700)
committerMicah Cowan <micah@cowan.name>
Sat, 12 Jul 2008 00:16:49 +0000 (17:16 -0700)
NEWS
doc/wget.texi
src/ChangeLog
src/main.c
src/retr.c

diff --git a/NEWS b/NEWS
index 63665c382eeed1abf816008d67a5ec9babcb9bdf..a57747942afb81491f837cc56f02ec479780c038 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 
 ** --ask-password option (and associated wgetrc command) added to
 support password prompts at the console.
 
 ** --ask-password option (and associated wgetrc command) added to
 support password prompts at the console.
+** The --input-file option now also handles retrieving links from
+an external file.
 \f
 * Changes in Wget 1.11.4
 
 \f
 * Changes in Wget 1.11.4
 
index 108d72177f1b69e7fcbac50685f770bb5f397344..50ee459e95c33fc3709566167d6ad7b04c9dc159 100644 (file)
@@ -480,9 +480,9 @@ printed.
 @cindex input-file
 @item -i @var{file}
 @itemx --input-file=@var{file}
 @cindex input-file
 @item -i @var{file}
 @itemx --input-file=@var{file}
-Read @sc{url}s from @var{file}.  If @samp{-} is specified as
-@var{file}, @sc{url}s are read from the standard input.  (Use
-@samp{./-} to read from a file literally named @samp{-}.)
+Read @sc{url}s from a local or external @var{file}.  If @samp{-} is
+specified as @var{file}, @sc{url}s are read from the standard input.  
+(Use @samp{./-} to read from a file literally named @samp{-}.)
 
 If this function is used, no @sc{url}s need be present on the command
 line.  If there are @sc{url}s both on the command line and in an input
 
 If this function is used, no @sc{url}s need be present on the command
 line.  If there are @sc{url}s both on the command line and in an input
index 57a053001c584806d57bb53467895848abfc1544..e551f1c9f176313a2c024fe971ded5402c282252 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-28  Steven Schubiger  <stsc@members.fsf.org>
+
+       * retr.c (retrieve_from_file): Allow for reading the links from
+       an external file (HTTP/FTP).
+
 2008-06-25  Steven Schubiger  <stsc@members.fsf.org>
 
        * ftp.c (getftp): When spidering a FTP URL, emit a diagnostic
 2008-06-25  Steven Schubiger  <stsc@members.fsf.org>
 
        * ftp.c (getftp): When spidering a FTP URL, emit a diagnostic
index dd6cf0295457591e0a84271ff596227f9fc91ef1..70387c9c5d6999fe38a3d9a582979e55f29ba641 100644 (file)
@@ -415,7 +415,7 @@ Logging and input file:\n"),
     N_("\
   -nv, --no-verbose          turn off verboseness, without being quiet.\n"),
     N_("\
     N_("\
   -nv, --no-verbose          turn off verboseness, without being quiet.\n"),
     N_("\
-  -i,  --input-file=FILE     download URLs found in FILE.\n"),
+  -i,  --input-file=FILE     download URLs found in local or external FILE.\n"),
     N_("\
   -F,  --force-html          treat input file as HTML.\n"),
     N_("\
     N_("\
   -F,  --force-html          treat input file as HTML.\n"),
     N_("\
index 7bdd4193fed50e1058c2c44a962394f002a3358d..58e00d2fe74102909f78cfdaa57ae5cc7caa304e 100644 (file)
@@ -822,10 +822,24 @@ retrieve_from_file (const char *file, bool html, int *count)
   uerr_t status;
   struct urlpos *url_list, *cur_url;
 
   uerr_t status;
   struct urlpos *url_list, *cur_url;
 
-  url_list = (html ? get_urls_html (file, NULL, NULL)
-              : get_urls_file (file));
+  char *input_file = NULL;
+  const char *url = file;
+
   status = RETROK;             /* Suppose everything is OK.  */
   *count = 0;                  /* Reset the URL count.  */
   status = RETROK;             /* Suppose everything is OK.  */
   *count = 0;                  /* Reset the URL count.  */
+  
+  if (url_has_scheme (url))
+    {
+      uerr_t status;
+      status = retrieve_url (url, &input_file, NULL, NULL, NULL, false);
+      if (status != RETROK)
+        return status;
+    }
+  else
+    input_file = (char *) file;
+
+  url_list = (html ? get_urls_html (input_file, NULL, NULL)
+              : get_urls_file (input_file));
 
   for (cur_url = url_list; cur_url; cur_url = cur_url->next, ++*count)
     {
 
   for (cur_url = url_list; cur_url; cur_url = cur_url->next, ++*count)
     {