Hello Alejandro,

here is a patch that fixes the issue with empty HTTP queries.

But the website has two files that can't be loaded (404 Not found). These 
files won't be translated to local filenames. This is a correct behaviour, 
since these files do not exist locally.

Guiseppe, put you in CC since I am not shure if you read all discussions in 
the list.

    Tim

Am Thursday 29 March 2012 schrieb Alejandro Supu:
> Hi,
> 
> I have found a bug on the latest version of the http client, wget 1.3.14
> 
> This is how to reproduce it:
> 
> If we save the page:
> http://accionistaseinversores.bbva.com/TLBB/tlbb/bbvair/esp/index.jsp with
> the following parameters: wget -k -p
> http://accionistaseinversores.bbva.com/TLBB/tlbb/bbvair/esp/index.jsp
> 
> On the saved "main.css" file
> (\accionistaseinversores.bbva.com\TLBB\fbinir\css), there are files that
> point to the remote files instead of the saved ones! For example, on line
> 57, 68 and 79, it points to
> http://accionistaseinversores.bbva.com/TLBB/fbinir/mult/stagsans-light-web
> font.eot instead of ../mult/stagsans-book-webfont.eot and this file was
> saved to local... There are other files with the same behaviour.
> 
> If you search the string "http" within the CSS file, you will find all the
> pointed files to remote instead of the local SAVED ones.
> 
> Please, tell me anything related to this bug or when it will be corrected.
> 
> THANKS!
-- 
OMS Open Media System GmbH
Holzdamm 40
20099 Hamburg
Fon +49-40-238878-40
Fax +49-40-238878-99
Email tim.rueh...@openmediasystem.de
Sitz und Registergericht Hamburg
HRB 57616
=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-03-25 15:49:55 +0000
+++ src/ChangeLog	2012-03-30 09:18:54 +0000
@@ -1,3 +1,7 @@
+2012-03-30  Tim Ruehsen  <tim.rueh...@gmx.de>
+
+	* url.c: use empty query in local filenames
+
 2012-03-25  Giuseppe Scrivano  <gscriv...@gnu.org>
 
 	* utils.c: Include <sys/ioctl.h>.

=== modified file 'src/url.c'
--- src/url.c	2011-01-01 12:19:37 +0000
+++ src/url.c	2012-03-30 09:14:56 +0000
@@ -1502,7 +1502,7 @@
 {
   struct growable fnres;        /* stands for "file name result" */
 
-  const char *u_file, *u_query;
+  const char *u_file;
   char *fname, *unique;
   char *index_filename = "index.html"; /* The default index file is index.html */
 
@@ -1561,12 +1561,11 @@
       u_file = *u->file ? u->file : index_filename;
       append_uri_pathel (u_file, u_file + strlen (u_file), false, &fnres);
 
-      /* Append "?query" to the file name. */
-      u_query = u->query && *u->query ? u->query : NULL;
-      if (u_query)
+      /* Append "?query" to the file name, even if empty */
+      if (u->query)
 	{
 	  append_char (FN_QUERY_SEP, &fnres);
-	  append_uri_pathel (u_query, u_query + strlen (u_query),
+	  append_uri_pathel (u->query, u->query + strlen (u->query),
 			     true, &fnres);
 	}
     }

Reply via email to