bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #60494] Percent character in filename gets escaped twice


From: Kode Charlie
Subject: [bug #60494] Percent character in filename gets escaped twice
Date: Sat, 15 May 2021 15:05:06 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36

Follow-up Comment #4, bug #60494 (project wget):

Here's one proposed change (see patch below).  It likely is not comprehensive
enough.  

The broader issue seems to be that there are circumstances in *./src/retr.c*
when *retrieve_url()* calls *url_parse()*, which already was called in
*./src/main.c*.  This can result in the *file* property in *struct url* being
modified in-place more than once (triggering errors as the one originally
reported in this issue).

For now, I'm going to defer making these changes (including suggested patch
below) to those more familiar with the *wget* repo than I.


diff --git a/src/http.c b/src/http.c
index d25762fa..a9fa237f 100644
--- a/src/http.c
+++ b/src/http.c
@@ -4280,8 +4280,10 @@ http_loop (const struct url *u, struct url
*original_url, char **newloc,
     }
   else if (!opt.content_disposition)
     {
-      hstat.local_file =
-        url_file_name (opt.trustservernames ? u : original_url, NULL);
+      if (opt.trustservernames)
+        hstat.local_file = url_file_name (u, NULL);
+      else
+        hstat.local_file = original_url->file;
       got_name = true;
     }


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60494>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]