Description of problem:
wget doesn't work with -P
Version-Release number of selected component (if applicable):
try with wget version 1.10.2-8.fc6.1
wget -P /etc http://kernel.org/pub/linux/kernel/v2.6/linux-220.127.116.11.tar.bz2
and try same command with wget version wget-1.10.2-3.2.1.i386.rpm
with wget-1.10.2-3.2.1.i386.rpm works, the file was downloaded on /etc, with
newer versions ( 1.10.2-8.fc6.1 ) the file will be downloaded on current
more details here.
The problem appears to be coming from this snippet in wget-1.10.2-to11.patch:
+ /* Determine the local filename if needed. Notice that if -O is used
+ * hstat.local_file is set by http_loop to the argument of -O. */
+ if (!hs->local_file)
+ /* Honor Content-Disposition whether possible. */
+ if (!opt.content_disposition
+ || !resp_header_copy (resp, "Content-Disposition",
+ hdrval, sizeof (hdrval))
+ || !parse_content_disposition (hdrval, &hs->local_file))
+ /* The Content-Disposition header is missing or broken.
+ * Choose unique file name according to given URL. */
+ hs->local_file = url_file_name (u);
The patch is honoring -O as mentioned in the comments, but not honoring -P when
there's a Content-disposition header in the HTTP response.
the to11 patch messed some other things up as well and has been removed in the