bug-wget
[Top][All Lists]
Advanced

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

[Bug-wget] Patch: Avoid unnecessary UTF-8 encoded fallback


From: YX Hao
Subject: [Bug-wget] Patch: Avoid unnecessary UTF-8 encoded fallback
Date: Wed, 25 Oct 2017 18:56:04 +0800

Dear there,

Things are clear as the patch shows. ☺

==================================================
diff --git a/src/retr.c b/src/retr.c
index a27d58af..c1bc600e 100644
--- a/src/retr.c
+++ b/src/retr.c
@@ -1098,11 +1098,16 @@ retrieve_url (struct url * orig_parsed, const char 
*origurl, char **file,
       u = url_parse (origurl, NULL, iri, true);
       if (u)
         {
-          DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url)));
-          xfree (url);
-          url = xstrdup (u->url);
-          iri_fallbacked = 1;
-          goto redirected;
+          if (strcmp(u->url, orig_parsed->url))
+            {
+              DEBUGP (("[IRI fallbacking to non-utf8 for %s\n", quote (url)));
+              xfree (url);
+              url = xstrdup (u->url);
+              iri_fallbacked = 1;
+              goto redirected;
+            }
+          else
+              DEBUGP (("[Needn't fallback to non-utf8 for %s\n", quote (url)));
         }
       else
           DEBUGP (("[Couldn't fallback to non-utf8 for %s\n", quote (url)));


Regards,
YX Hao

Attachment: wget_v1.9.1_Avoid_unnecessary_UTF-8_encoded_fallback.patch
Description: Binary data


reply via email to

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