]> sjero.net Git - wget/blobdiff - src/url.c
Fix checking the URL length when filename is specified
[wget] / src / url.c
index 5e2b9a3bde9f1a0d79a74bfc093317ceb3e21783..f554432c081280cc56cade20ddc98d6f28ec07a1 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -701,7 +701,10 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode)
       if (!iri->utf8_encode)
         new_url = NULL;
       else
-        iri->orig_url = xstrdup (url);
+        {
+          iri->orig_url = xstrdup (url);
+          percent_encode = true;
+        }
     }
 
   /* XXX XXX Could that change introduce (security) bugs ???  XXX XXX*/
@@ -1669,11 +1672,12 @@ url_file_name (const struct url *u, char *replaced_filename)
      2) Retrieval with regetting.
      3) Timestamping is used.
      4) Hierarchy is built.
+     5) Backups are specified.
 
      The exception is the case when file does exist and is a
      directory (see `mkalldirs' for explanation).  */
 
-  if ((opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct)
+  if (ALLOW_CLOBBER
       && !(file_exists_p (fname) && !file_non_directory_p (fname)))
     {
       unique = fname;