X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Furl.c;h=c94895979a7c9f532f6497fcf9c0659efd55c18a;hp=32de9c751fdc358e94ed9422d2d191493b7a0949;hb=1e9ced017082976d257a7a158d9b6aca49f3c690;hpb=da6b3f4b614fb8b28bf388b66f21efc5d553ebb9 diff --git a/src/url.c b/src/url.c index 32de9c75..c9489597 100644 --- a/src/url.c +++ b/src/url.c @@ -641,7 +641,7 @@ static const char *parse_errors[] = { error, and if ERROR is not NULL, also set *ERROR to the appropriate error code. */ struct url * -url_parse (const char *url, int *error, bool *utf8_encode) +url_parse (const char *url, int *error) { struct url *u; const char *p; @@ -671,12 +671,14 @@ url_parse (const char *url, int *error, bool *utf8_encode) goto error; } - if (opt.enable_iri && *utf8_encode) + if (opt.enable_iri && get_utf8_encode () && !get_ugly_no_encode ()) { const char *new; + bool utf8_encode; url_unescape ((char *) url); - *utf8_encode = remote_to_utf8 (url, &new); - if (*utf8_encode) + utf8_encode = remote_to_utf8 (url, &new); + set_utf8_encode (utf8_encode); + if (utf8_encode) url = new; } @@ -856,7 +858,7 @@ url_parse (const char *url, int *error, bool *utf8_encode) if (opt.enable_iri) { - char *new = idn_encode (u->host, *utf8_encode); + char *new = idn_encode (u->host, get_utf8_encode ()); if (new) { xfree (u->host);