bug-wget
[Top][All Lists]
Advanced

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

Re: [Bug-wget] Wget skips converting links to relative if they contain s


From: Giuseppe Scrivano
Subject: Re: [Bug-wget] Wget skips converting links to relative if they contain spaces
Date: Fri, 20 Aug 2010 03:12:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello,


David <address@hidden> writes:

> Hi all,
>
> I'm having issues with Wget 1.12 (on Ubuntu 10.04, 32 bit) and Wget
> skipping converting links with spaces in them.  Wget downloads the
> linked files fine if they have spaces in the filenames, but skips
> converting the link to relative when the --convert-links (-k) option
> is enabled.  All other similar links work fine; the only difference I
> can see is the presence of the space character.
>
> Running wget like: wget -p -np -k --debug
> http://mysite.org.au/sponsors/ produces this snippet of relevant
> information about the skipped conversion:


Thanks for your report, I am going to apply this patch, it should fix
the problem.


Cheers,
Giuseppe



=== modified file 'src/convert.c'
--- src/convert.c       2010-07-09 10:24:51 +0000
+++ src/convert.c       2010-08-20 00:58:31 +0000
@@ -47,6 +47,7 @@
 #include "res.h"
 #include "html-url.h"
 #include "css-url.h"
+#include "iri.h"
 
 static struct hash_table *dl_file_url_map;
 struct hash_table *dl_url_file_map;
@@ -105,7 +106,8 @@
       for (cur_url = urls; cur_url; cur_url = cur_url->next)
         {
           char *local_name;
-          struct url *u = cur_url->url;
+          struct url *u;
+          struct iri *pi;
 
           if (cur_url->link_base_p)
             {
@@ -119,6 +121,11 @@
           /* We decide the direction of conversion according to whether
              a URL was downloaded.  Downloaded URLs will be converted
              ABS2REL, whereas non-downloaded will be converted REL2ABS.  */
+
+          pi = iri_new ();
+          set_uri_encoding (pi, opt.locale, true);
+
+          u = url_parse (cur_url->url->url, NULL, pi, true);
           local_name = hash_table_get (dl_url_file_map, u->url);
 
           /* Decide on the conversion type.  */
@@ -144,6 +151,9 @@
               cur_url->local_name = NULL;
               DEBUGP (("will convert url %s to complete\n", u->url));
             }
+
+          url_free (u);
+          iri_free (pi);
         }
 
       /* Convert the links in the file.  */




reply via email to

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