]> sjero.net Git - wget/blobdiff - src/url.c
Get rid of the supplementary bool pointer in url_parse () arguments; UGLY :)
[wget] / src / url.c
index 32de9c751fdc358e94ed9422d2d191493b7a0949..c94895979a7c9f532f6497fcf9c0659efd55c18a 100644 (file)
--- 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);