X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Frecur.c;h=921c60c787848c1315847d096d8ab6fe6b511a91;hp=71fbe7bf1f73767b47b105e44042cb6e81cb8c88;hb=723dbfc818e3e5b22ec53fd093dca999290ebead;hpb=e6b4e761d1f1439b1b2352f5eeaedd1ae5b9d76e diff --git a/src/recur.c b/src/recur.c index 71fbe7bf..921c60c7 100644 --- a/src/recur.c +++ b/src/recur.c @@ -187,7 +187,7 @@ static bool descend_redirect_p (const char *, const char *, int, options, add it to the queue. */ uerr_t -retrieve_tree (const char *start_url) +retrieve_tree (const char *start_url, struct iri *pi) { uerr_t status = RETROK; @@ -201,7 +201,18 @@ retrieve_tree (const char *start_url) int up_error_code; struct url *start_url_parsed; struct iri *i = iri_new (); - set_uri_encoding (i, opt.locale, true); + +#define COPYSTR(x) (x) ? xstrdup(x) : NULL; + /* Duplicate pi struct if not NULL */ + if (pi) + { + i->uri_encoding = COPYSTR (pi->uri_encoding); + i->content_encoding = COPYSTR (pi->content_encoding); + i->utf8_encode = pi->utf8_encode; + } + else + set_uri_encoding (i, opt.locale, true); +#undef COPYSTR start_url_parsed = url_parse (start_url, &up_error_code, i); if (!start_url_parsed)