mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Fixes to restore Test-iri and Test-iri-forced-remote
This commit is contained in:
parent
4f3dd68173
commit
50e12521d6
14
src/main.c
14
src/main.c
@ -1203,7 +1203,13 @@ WARNING: Can't reopen standard output in binary mode;\n\
|
||||
{
|
||||
char *filename = NULL, *redirected_URL = NULL;
|
||||
int dt, url_err;
|
||||
struct url *url_parsed = url_parse (*t, &url_err, NULL, false);
|
||||
/* Need to do a new struct iri every time, because
|
||||
* retrieve_url may modify it in some circumstances,
|
||||
* currently. */
|
||||
struct iri *iri = iri_new ();
|
||||
struct url *url_parsed = url_parse (*t, &url_err, iri, true);
|
||||
|
||||
set_uri_encoding (iri, opt.locale, true);
|
||||
|
||||
if (!url_parsed)
|
||||
{
|
||||
@ -1229,11 +1235,8 @@ WARNING: Can't reopen standard output in binary mode;\n\
|
||||
}
|
||||
else
|
||||
{
|
||||
struct iri *i = iri_new ();
|
||||
set_uri_encoding (i, opt.locale, true);
|
||||
status = retrieve_url (url_parsed, *t, &filename, &redirected_URL,
|
||||
NULL, &dt, opt.recursive, i);
|
||||
iri_free (i);
|
||||
NULL, &dt, opt.recursive, iri);
|
||||
}
|
||||
|
||||
if (opt.delete_after && file_exists_p(filename))
|
||||
@ -1247,6 +1250,7 @@ WARNING: Can't reopen standard output in binary mode;\n\
|
||||
xfree_null (filename);
|
||||
url_free (url_parsed);
|
||||
}
|
||||
iri_free (iri);
|
||||
}
|
||||
|
||||
/* And then from the input file, if any. */
|
||||
|
@ -278,7 +278,7 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
|
||||
{
|
||||
int dt = 0, url_err;
|
||||
char *redirected = NULL;
|
||||
struct url *url_parsed = url_parse (url, &url_err, i, false);
|
||||
struct url *url_parsed = url_parse (url, &url_err, i, true);
|
||||
|
||||
status = retrieve_url (url_parsed, url, &file, &redirected, referer,
|
||||
&dt, false, i);
|
||||
@ -373,7 +373,7 @@ retrieve_tree (struct url *start_url_parsed, struct iri *pi)
|
||||
if (children)
|
||||
{
|
||||
struct urlpos *child = children;
|
||||
struct url *url_parsed = url_parse (url, NULL, i, false);
|
||||
struct url *url_parsed = url_parse (url, NULL, i, true);
|
||||
struct iri *ci;
|
||||
char *referer_url = url;
|
||||
bool strip_auth = (url_parsed != NULL
|
||||
|
10
src/retr.c
10
src/retr.c
@ -796,9 +796,19 @@ retrieve_url (struct url * orig_parsed, const char *origurl, char **file,
|
||||
if (!(*dt & RETROKF) && iri->utf8_encode)
|
||||
{
|
||||
iri->utf8_encode = false;
|
||||
if (orig_parsed != u)
|
||||
{
|
||||
url_free (u);
|
||||
}
|
||||
u = url_parse (origurl, NULL, iri, true);
|
||||
if (u)
|
||||
{
|
||||
DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url)));
|
||||
goto second_try;
|
||||
}
|
||||
else
|
||||
DEBUGP (("[Couldn't fallback to non-utf8 for %s\n", quote (url)));
|
||||
}
|
||||
|
||||
if (local_file && *dt & RETROKF)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user