--- wget-1.12.1-devel-orig/src/retr.c 2009-09-09 19:59:46 -0400 +++ wget-1.12.1-devel/src/retr.c 2009-12-10 22:53:01 -0500 @@ -890,7 +890,9 @@ struct iri *iri = iri_new(); char *input_file = NULL; - const char *url = file; + + int url_err = 0; + struct url *url_parsed = NULL; status = RETROK; /* Suppose everything is OK. */ *count = 0; /* Reset the URL count. */ @@ -899,19 +901,13 @@ set_uri_encoding (iri, opt.locale, true); set_content_encoding (iri, opt.locale); - if (url_has_scheme (url)) + url_parsed = url_parse( file, &url_err, iri, true ); + /* Check if input file is a URL */ + if( url_parsed ) { - int dt,url_err; + const char *url = file; + int dt = 0; uerr_t status; - struct url * url_parsed = url_parse(url, &url_err, iri, true); - - if (!url_parsed) - { - char *error = url_error (url, url_err); - logprintf (LOG_NOTQUIET, "%s: %s.\n", url, error); - xfree (error); - return URLERROR; - } if (!opt.base_href) opt.base_href = xstrdup (url); @@ -934,7 +930,7 @@ xfree_null (iri->orig_url); iri->orig_url = NULL; } - else + else /* input file is not a URL */ input_file = (char *) file; url_list = (html ? get_urls_html (input_file, NULL, NULL, iri)