Patch to fix --save-headers bug and additional functionality

"Phill Bertolus" <[email protected]> Mon, 1 Aug 2005 16:26:22 +1000
Newsgroups gmane.comp.web.wget.patches
Message-ID <[email protected]>
This is a multi-part message in MIME format.

------=_NextPart_000_0082_01C596B5.C10ED970
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_0083_01C596B5.C10ED970"


------=_NextPart_001_0083_01C596B5.C10ED970
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

RegardsHi patches,

Here's a patch that fixes (hacks) the --save-headers bug in 1.10.

Also added are:

a) --no-redirects (self explanatory)
b) --wvdat-ext (rename all files to have suffix of .wvdat)
c) --save_headers_file (save headers to file with .wvhdr suffix)
d) --no-https (self explanatory)
e) --clobber-old (force overwrite of existing file no matter what)

The suffix commands allow the mime types transmitted in the headers to =
used in subsequent processing. i.e you look in .wvhdr file to determine =
the content type and then process the .wvdat file accordingly.

The other are pretty much self explanatory.

Hope this is useful to you.

Cheers
Phill.

Phillip Bertolus
CTO, WebWombat Pty Limited

Delivering Access Controlled Search to Corporate Information.

( +61 (0) 3 9675-0901 Office
( +61 (0) 416 326 853 mobile
( +61 (0) 3 9675-0999 fax
* <mailto:[email protected]>
8 <http://www.wombattechnology.com.au/>

Level 6, 10 Queen Street, Melbourne, Victoria 3000


__________________________________________________________
The information transmitted is intended only for the person or entity to =
which it is addressed=20

and may contain confidential and/or privileged material.  Any review, =
retransmission,=20

dissemination or other use of, or taking of any action in reliance upon, =
this information by=20

persons or entities other than the intended recipient is prohibited. If =
you received this in error,=20

please contact the sender and delete the material from any computer.

=20

------=_NextPart_001_0083_01C596B5.C10ED970
Content-Type: text/html;
	charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Regards</TITLE><BASE=
=20
href=3D"file://S:\Mail SignOff\">
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1252">
<META content=3DWord.Document name=3DProgId>
<META content=3D"MSHTML 6.00.2800.1498" name=3DGENERATOR>
<META content=3D"Microsoft Word 9" name=3DOriginator><LINK=20
href=3D"./Peter%20Sign-off_files/filelist.xml" rel=3DFile-List><!--[if =
gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>peterm</o:Author>
  <o:Template>Normal</o:Template>
  <o:LastAuthor>peterm</o:LastAuthor>
  <o:Revision>1</o:Revision>
  <o:TotalTime>6</o:TotalTime>
  <o:Created>2004-05-24T01:13:00Z</o:Created>
  <o:LastSaved>2004-05-24T01:19:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Company>Web Wombat Pty Ltd</o:Company>
  <o:Lines>1</o:Lines>
  <o:Paragraphs>1</o:Paragraphs>
  <o:Version>9.2720</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
<STYLE>@font-face {
	font-family: Wingdings;
}
@font-face {
	font-family: Verdana;
}
@font-face {
	font-family: ver;
}
@font-face {
	font-family: Trebuchet MS;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt =
90.0pt; mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; =
mso-paper-source: 0; }
P.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
LI.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
DIV.MsoNormal {
	FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; =
mso-style-parent: ""; mso-pagination: widow-orphan; =
mso-fareast-font-family: "Times New Roman"
}
A:link {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
	COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
	COLOR: purple; TEXT-DECORATION: underline; text-underline: single
}
DIV.Section1 {
	page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-AU style=3D"tab-interval: 36.0pt" vLink=3D#999999 =
link=3D#999999=20
bgColor=3D#ffffff>
<DIV>Hi patches,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here's a patch that fixes (hacks) the --save-headers bug in =
1.10.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Also added are:</DIV>
<DIV>&nbsp;</DIV>
<DIV>a) --no-redirects (self explanatory)</DIV>
<DIV>b) --wvdat-ext (rename all files to have suffix of .wvdat)</DIV>
<DIV>c) --save_headers_file (save headers to file with .wvhdr =
suffix)</DIV>
<DIV>d) --no-https (self explanatory)</DIV>
<DIV>e) --clobber-old (force overwrite of existing file no matter =
what)</DIV>
<DIV>&nbsp;</DIV>
<DIV>The suffix commands allow the mime types transmitted in the headers =
to used=20
in subsequent processing. i.e you look in .wvhdr file to determine the =
content=20
type and then process the .wvdat file accordingly.</DIV>
<DIV>&nbsp;</DIV>
<DIV>The other are pretty much self explanatory.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Hope this is useful to you.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>Phill.</DIV>
<DIV>&nbsp;</DIV>
<DIV class=3DSection1>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">Phillip=20
Bertolus<BR>CTO, WebWombat Pty Limited</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Trebuchet =
MS'"><BR><BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana"><B>Delivering Access=20
Controlled Search to Corporate Information.<BR></B></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Trebuchet =
MS'"><BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Wingdings">(</SPAN> =
<SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">+61 =
(0)</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"> =
</SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">3</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Trebuchet MS'"> =
</SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">9675-0901</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"> =
</SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">Office</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: =
Wingdings">(</SPAN><SPAN=20
style=3D"COLOR: gray"> </SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">+61 (0) =
416 326 853=20
mobile<BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: =
Wingdings">(</SPAN><SPAN=20
style=3D"COLOR: gray"> </SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">+61 (0) 3 =
9675-0999=20
fax</SPAN><SPAN style=3D"COLOR: gray"><BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: =
Wingdings">*</SPAN><SPAN=20
style=3D"COLOR: gray"> </SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">&lt;</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Trebuchet MS'"><A=20
href=3D"mailto:[email protected]"><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">mailto:[email protected]</SPAN></A></SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">&gt;</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: =
Verdana"><BR></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: =
Wingdings">8</SPAN><SPAN=20
style=3D"COLOR: gray"> </SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">&lt;<A=20
href=3D"http://www.wombattechnology.com.au/">http://www.wombattechnology.=
com.au/</A>&gt;</SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Trebuchet =
MS'"><BR></SPAN><I><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana"><BR=20
style=3D"mso-special-character: line-break"><![if =
!supportLineBreakNewLine]></SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana"><FONT=20
color=3D#999999>Level 6, 10 Queen Street, Melbourne, Victoria=20
3000</FONT></SPAN><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Verdana"><BR=20
style=3D"mso-special-character: line-break"><![endif]></SPAN></I><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Trebuchet =
MS'">__________________________________________________________<BR></SPAN=
><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">The =
information=20
transmitted is intended only for the person or entity to which it is =
addressed=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">and may =
contain=20
confidential and/or privileged material.&nbsp; Any review, =
retransmission,=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: =
Verdana">dissemination or=20
other use of, or taking of any action in reliance upon, this information =
by=20
<o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">persons or =
entities=20
other than the intended recipient is prohibited.&nbsp;If you received =
this in=20
error, <o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 7.5pt; COLOR: gray; FONT-FAMILY: Verdana">please =
contact the=20
sender and delete the material from any computer.</SPAN><SPAN=20
style=3D"FONT-FAMILY: Verdana"><o:p></o:p></SPAN></P>
<P class=3DMsoNormal><SPAN style=3D"FONT-FAMILY: Verdana"><![if =
!supportEmptyParas]><![endif]>&nbsp;<o:p></o:p></SPAN></P></DIV></BODY></=
HTML>

------=_NextPart_001_0083_01C596B5.C10ED970--

------=_NextPart_000_0082_01C596B5.C10ED970
Content-Type: application/octet-stream;
	name="wget110-wvdat-wvhdr-clobberold-noredir.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="wget110-wvdat-wvhdr-clobberold-noredir.patch"

diff -uNr wget-1.10.orig/src/http.c wget-1.10/src/http.c=0A=
--- wget-1.10.orig/src/http.c	Tue May 31 00:29:01 2005=0A=
+++ wget-1.10/src/http.c	Mon Aug  1 15:45:04 2005=0A=
@@ -1144,6 +1144,7 @@=0A=
   wgint contlen, contrange;=0A=
   struct url *conn;=0A=
   FILE *fp;=0A=
+  FILE *fphdr;=0A=
 =0A=
   int sock =3D -1;=0A=
   int flags;=0A=
@@ -1167,6 +1168,8 @@=0A=
   char hdrval[256];=0A=
   char *message;=0A=
 =0A=
+  char headBuffer[31768]; /* Dummies killed header saving. Hack 2 fix */=0A=
+=0A=
   /* Whether this connection will be kept alive after the HTTP request=0A=
      is done. */=0A=
   int keep_alive;=0A=
@@ -1576,6 +1579,12 @@=0A=
 	  request_free (req);=0A=
 	  return HERR;=0A=
 	}=0A=
+      headBuffer[0] =3D '\0';=0A=
+    }=0A=
+  else if (opt.save_headers || opt.save_headers2file)=0A=
+    {=0A=
+      strncpy(headBuffer, head, sizeof(headBuffer) - 1);=0A=
+      headBuffer[32767] =3D '\0';=0A=
     }=0A=
   DEBUGP (("\n---response begin---\n%s---response end---\n", head));=0A=
 =0A=
@@ -1809,6 +1818,23 @@=0A=
 	}=0A=
     }=0A=
 =0A=
+  if (opt.extwvdat)=0A=
+  {=0A=
+    char* last_period_in_local_filename =3D strrchr(*hs->local_file, =
'.');=0A=
+=0A=
+   /*=0A=
+    * Check if .wvdat extension is present.=0A=
+    */=0A=
+    if (last_period_in_local_filename =3D=3D NULL ||=0A=
+        strcasecmp(last_period_in_local_filename, ".wvdat") !=3D 0)=0A=
+    {=0A=
+      size_t  local_filename_len =3D strlen(*hs->local_file);=0A=
+=0A=
+      *hs->local_file =3D xrealloc(*hs->local_file, local_filename_len =
+ sizeof(".wvdat"));=0A=
+      strcpy(*hs->local_file + local_filename_len, ".wvdat");=0A=
+    }=0A=
+  }=0A=
+=0A=
   if (statcode =3D=3D HTTP_STATUS_RANGE_NOT_SATISFIABLE)=0A=
     {=0A=
       /* If `-c' is in use and the file has been fully downloaded (or=0A=
@@ -1904,7 +1930,11 @@=0A=
 	{=0A=
 	  fp =3D fopen_excl (*hs->local_file, 1);=0A=
 	  if (!fp && errno =3D=3D EEXIST)=0A=
-	    {=0A=
+          {=0A=
+            if (opt.clobberold)=0A=
+            {=0A=
+              fp =3D fopen (*hs->local_file, "wb");=0A=
+            } else {=0A=
 	      /* We cannot just invent a new name and use it (which is=0A=
 		 what functions like unique_create typically do)=0A=
 		 because we told the user we'd use this name.=0A=
@@ -1914,7 +1944,8 @@=0A=
 			 *hs->local_file);=0A=
 	      CLOSE_INVALIDATE (sock);=0A=
 	      return FOPEN_EXCL_ERR;=0A=
-	    }=0A=
+            }=0A=
+          }=0A=
 	}=0A=
       if (!fp)=0A=
 	{=0A=
@@ -1922,6 +1953,33 @@=0A=
 	  CLOSE_INVALIDATE (sock);=0A=
 	  return FOPENERR;=0A=
 	}=0A=
+=0A=
+      if (opt.save_headers2file)=0A=
+      {=0A=
+        char  lcFname[32768];=0A=
+        char* last_period_in_local_filename;=0A=
+=0A=
+        strcpy(lcFname, *hs->local_file);=0A=
+       /*=0A=
+        * Check if .wvdat extension is present and replace it with =
.wvhdr=0A=
+        */=0A=
+        last_period_in_local_filename =3D strrchr(lcFname, '.');=0A=
+        if (last_period_in_local_filename !=3D NULL &&=0A=
+            strcasecmp(last_period_in_local_filename, ".wvdat") =3D=3D =
0)=0A=
+        {=0A=
+          strcpy(last_period_in_local_filename, ".wvhdr");=0A=
+        } else {=0A=
+          strcat(lcFname, ".wvhdr");=0A=
+        }=0A=
+        fphdr =3D fopen (lcFname, hs->restval ? "ab" : "wb");=0A=
+        if (!fphdr)=0A=
+        {=0A=
+          logprintf (LOG_NOTQUIET, "%s: %s\n", lcFname, strerror =
(errno));=0A=
+          CLOSE_INVALIDATE (sock); /* would be CLOSE_FINISH, but there=0A=
+                                      might be more bytes in the body. =
*/=0A=
+          return FOPENERR;=0A=
+        }=0A=
+      }=0A=
     }=0A=
   else=0A=
     fp =3D output_stream;=0A=
@@ -1929,7 +1987,9 @@=0A=
   /* #### This confuses the timestamping code that checks for file=0A=
      size.  Maybe we should save some additional information?  */=0A=
   if (opt.save_headers)=0A=
-    fwrite (head, 1, strlen (head), fp);=0A=
+    fwrite (headBuffer, 1, strlen(headBuffer), fp);=0A=
+  if (opt.save_headers2file)=0A=
+    fwrite (headBuffer, 1, strlen(headBuffer), fphdr);=0A=
 =0A=
   /* Download the request body.  */=0A=
   flags =3D 0;=0A=
@@ -1956,9 +2016,15 @@=0A=
        errors could go unnoticed!  */=0A=
     int flush_res;=0A=
     if (!output_stream)=0A=
+    {=0A=
       flush_res =3D fclose (fp);=0A=
+      if (opt.save_headers2file) fclose(fphdr);=0A=
+    }=0A=
     else=0A=
+    {=0A=
       flush_res =3D fflush (fp);=0A=
+      if (opt.save_headers2file) fflush(fphdr);=0A=
+    }=0A=
     if (flush_res =3D=3D EOF)=0A=
       hs->res =3D -2;=0A=
   }=0A=
@@ -2033,7 +2099,11 @@=0A=
   hstat.referer =3D referer;=0A=
 =0A=
   filename_len =3D strlen (*hstat.local_file);=0A=
+ /*=0A=
+  * Need a tad more space for the longer extension should it be needed.=0A=
   filename_plus_orig_suffix =3D alloca (filename_len + sizeof =
(".orig"));=0A=
+  */=0A=
+  filename_plus_orig_suffix =3D alloca (filename_len + sizeof =
(".wvdat"));=0A=
 =0A=
   if (opt.noclobber && file_exists_p (*hstat.local_file))=0A=
     {=0A=
@@ -2086,7 +2156,21 @@=0A=
 	      local_dot_orig_file_exists =3D 1;=0A=
 	      local_filename =3D filename_plus_orig_suffix;=0A=
 	    }=0A=
-	}      =0A=
+	}=0A=
+=0A=
+      if (opt.extwvdat)=0A=
+      {=0A=
+         memcpy (filename_plus_orig_suffix, *hstat.local_file, =
filename_len);=0A=
+         memcpy (filename_plus_orig_suffix + filename_len, ".wvdat", =
sizeof (".wvdat"));=0A=
+=0A=
+         /* Try to stat() the .orig file. */=0A=
+         if (stat (filename_plus_orig_suffix, &st) =3D=3D 0)=0A=
+         {=0A=
+            local_dot_orig_file_exists =3D 1;=0A=
+            local_filename =3D filename_plus_orig_suffix;=0A=
+         }=0A=
+      }=0A=
+=0A=
 =0A=
       if (!local_dot_orig_file_exists)=0A=
 	/* Couldn't stat() <file>.orig, so try to stat() <file>. */=0A=
diff -uNr wget-1.10.orig/src/init.c wget-1.10/src/init.c=0A=
--- wget-1.10.orig/src/init.c	Mon May 30 23:31:23 2005=0A=
+++ wget-1.10/src/init.c	Mon Aug  1 14:42:56 2005=0A=
@@ -131,6 +131,7 @@=0A=
   { "certificatetype",	&opt.cert_type,		cmd_cert_type },=0A=
   { "checkcertificate", &opt.check_cert,	cmd_boolean },=0A=
 #endif=0A=
+  { "clobberold",       &opt.clobberold,        cmd_boolean },=0A=
   { "connecttimeout",	&opt.connect_timeout,	cmd_time },=0A=
   { "continue",		&opt.always_rest,	cmd_boolean },=0A=
   { "convertlinks",	&opt.convert_links,	cmd_boolean },=0A=
@@ -154,6 +155,7 @@=0A=
 #endif=0A=
   { "excludedirectories", &opt.excludes,	cmd_directory_vector },=0A=
   { "excludedomains",	&opt.exclude_domains,	cmd_vector },=0A=
+  { "extwvdat",         &opt.extwvdat,          cmd_boolean },=0A=
   { "followftp",	&opt.follow_ftp,	cmd_boolean },=0A=
   { "followtags",	&opt.follow_tags,	cmd_vector },=0A=
   { "forcehtml",	&opt.force_html,	cmd_boolean },=0A=
@@ -188,8 +190,10 @@=0A=
   { "mirror",		NULL,			cmd_spec_mirror },=0A=
   { "netrc",		&opt.netrc,		cmd_boolean },=0A=
   { "noclobber",	&opt.noclobber,		cmd_boolean },=0A=
+  { "nohttps",          &opt.no_https,          cmd_boolean },=0A=
   { "noparent",		&opt.no_parent,		cmd_boolean },=0A=
   { "noproxy",		&opt.no_proxy,		cmd_vector },=0A=
+  { "noredirects",      &opt.no_redirects,      cmd_boolean },=0A=
   { "numtries",		&opt.ntry,		cmd_number_inf },/* deprecated*/=0A=
   { "outputdocument",	&opt.output_document,	cmd_file },=0A=
   { "pagerequisites",	&opt.page_requisites,	cmd_boolean },=0A=
@@ -228,6 +232,7 @@=0A=
   { "robots",		&opt.use_robots,	cmd_boolean },=0A=
   { "savecookies",	&opt.cookies_output,	cmd_file },=0A=
   { "saveheaders",	&opt.save_headers,	cmd_boolean },=0A=
+  { "saveheaders2file", &opt.save_headers2file, cmd_boolean },=0A=
 #ifdef HAVE_SSL=0A=
   { "secureprotocol",	&opt.secure_protocol,	cmd_spec_secure_protocol },=0A=
 #endif=0A=
diff -uNr wget-1.10.orig/src/main.c wget-1.10/src/main.c=0A=
--- wget-1.10.orig/src/main.c	Sat May  7 01:50:50 2005=0A=
+++ wget-1.10/src/main.c	Mon Aug  1 15:00:56 2005=0A=
@@ -152,119 +152,124 @@=0A=
 =0A=
 struct cmdline_option option_data[] =3D=0A=
   {=0A=
-    { "accept", 'A', OPT_VALUE, "accept", -1 },=0A=
-    { "append-output", 'a', OPT__APPEND_OUTPUT, NULL, required_argument =
},=0A=
-    { "background", 'b', OPT_BOOLEAN, "background", -1 },=0A=
-    { "backup-converted", 'K', OPT_BOOLEAN, "backupconverted", -1 },=0A=
-    { "backups", 0, OPT_BOOLEAN, "backups", -1 },=0A=
-    { "base", 'B', OPT_VALUE, "base", -1 },=0A=
-    { "bind-address", 0, OPT_VALUE, "bindaddress", -1 },=0A=
-    { IF_SSL ("ca-certificate"), 0, OPT_VALUE, "cacertificate", -1 },=0A=
-    { IF_SSL ("ca-directory"), 0, OPT_VALUE, "cadirectory", -1 },=0A=
-    { "cache", 0, OPT_BOOLEAN, "cache", -1 },=0A=
-    { IF_SSL ("certificate"), 0, OPT_VALUE, "certificate", -1 },=0A=
-    { IF_SSL ("certificate-type"), 0, OPT_VALUE, "certificatetype", -1 =
},=0A=
-    { IF_SSL ("check-certificate"), 0, OPT_BOOLEAN, "checkcertificate", =
-1 },=0A=
-    { "clobber", 0, OPT__CLOBBER, NULL, optional_argument },=0A=
-    { "connect-timeout", 0, OPT_VALUE, "connecttimeout", -1 },=0A=
-    { "continue", 'c', OPT_BOOLEAN, "continue", -1 },=0A=
-    { "convert-links", 'k', OPT_BOOLEAN, "convertlinks", -1 },=0A=
-    { "cookies", 0, OPT_BOOLEAN, "cookies", -1 },=0A=
-    { "cut-dirs", 0, OPT_VALUE, "cutdirs", -1 },=0A=
-    { IF_DEBUG ("debug"), 'd', OPT_BOOLEAN, "debug", -1 },=0A=
-    { "delete-after", 0, OPT_BOOLEAN, "deleteafter", -1 },=0A=
-    { "directories", 0, OPT_BOOLEAN, "dirstruct", -1 },=0A=
-    { "directory-prefix", 'P', OPT_VALUE, "dirprefix", -1 },=0A=
-    { "dns-cache", 0, OPT_BOOLEAN, "dnscache", -1 },=0A=
-    { "dns-timeout", 0, OPT_VALUE, "dnstimeout", -1 },=0A=
-    { "domains", 'D', OPT_VALUE, "domains", -1 },=0A=
-    { "dont-remove-listing", 0, OPT__DONT_REMOVE_LISTING, NULL, =
no_argument },=0A=
-    { "dot-style", 0, OPT_VALUE, "dotstyle", -1 },=0A=
-    { "egd-file", 0, OPT_VALUE, "egdfile", -1 },=0A=
-    { "exclude-directories", 'X', OPT_VALUE, "excludedirectories", -1 },=0A=
-    { "exclude-domains", 0, OPT_VALUE, "excludedomains", -1 },=0A=
-    { "execute", 'e', OPT__EXECUTE, NULL, required_argument },=0A=
-    { "follow-ftp", 0, OPT_BOOLEAN, "followftp", -1 },=0A=
-    { "follow-tags", 0, OPT_VALUE, "followtags", -1 },=0A=
-    { "force-directories", 'x', OPT_BOOLEAN, "dirstruct", -1 },=0A=
-    { "force-html", 'F', OPT_BOOLEAN, "forcehtml", -1 },=0A=
-    { "ftp-password", 0, OPT_VALUE, "ftppassword", -1 },=0A=
-    { "ftp-user", 0, OPT_VALUE, "ftpuser", -1 },=0A=
-    { "glob", 0, OPT_BOOLEAN, "glob", -1 },=0A=
-    { "header", 0, OPT_VALUE, "header", -1 },=0A=
-    { "help", 'h', OPT_FUNCALL, (void *)print_help, no_argument },=0A=
-    { "host-directories", 0, OPT_BOOLEAN, "addhostdir", -1 },=0A=
-    { "html-extension", 'E', OPT_BOOLEAN, "htmlextension", -1 },=0A=
-    { "htmlify", 0, OPT_BOOLEAN, "htmlify", -1 },=0A=
-    { "http-keep-alive", 0, OPT_BOOLEAN, "httpkeepalive", -1 },=0A=
-    { "http-passwd", 0, OPT_VALUE, "httppassword", -1 }, /* deprecated =
*/=0A=
-    { "http-password", 0, OPT_VALUE, "httppassword", -1 },=0A=
-    { "http-user", 0, OPT_VALUE, "httpuser", -1 },=0A=
-    { "ignore-length", 0, OPT_BOOLEAN, "ignorelength", -1 },=0A=
-    { "ignore-tags", 0, OPT_VALUE, "ignoretags", -1 },=0A=
-    { "include-directories", 'I', OPT_VALUE, "includedirectories", -1 },=0A=
+    { "accept",                    'A', OPT_VALUE,    "accept",         =
  -1 },=0A=
+    { "append-output",             'a', OPT__APPEND_OUTPUT, NULL, =
required_argument },=0A=
+    { "background",                'b', OPT_BOOLEAN,  "background",     =
  -1 },=0A=
+    { "backup-converted",          'K', OPT_BOOLEAN,  =
"backupconverted",  -1 },=0A=
+    { "backups",                    0,  OPT_BOOLEAN,  "backups",        =
  -1 },=0A=
+    { "base",                      'B', OPT_VALUE,    "base",           =
  -1 },=0A=
+    { "bind-address",               0,  OPT_VALUE,    "bindaddress",    =
  -1 },=0A=
+    { IF_SSL ("ca-certificate"),    0,  OPT_VALUE,    "cacertificate",  =
  -1 },=0A=
+    { IF_SSL ("ca-directory"),      0,  OPT_VALUE,    "cadirectory",    =
  -1 },=0A=
+    { "cache",                      0,  OPT_BOOLEAN,  "cache",          =
  -1 },=0A=
+    { IF_SSL ("certificate"),       0,  OPT_VALUE,    "certificate",    =
  -1 },=0A=
+    { IF_SSL ("certificate-type"),  0,  OPT_VALUE,    =
"certificatetype",  -1 },=0A=
+    { IF_SSL ("check-certificate"), 0,  OPT_BOOLEAN,  =
"checkcertificate", -1 },=0A=
+    { "clobber",                    0,  OPT__CLOBBER, NULL, =
optional_argument },=0A=
+    { "clobber-old",                0,  OPT_BOOLEAN,  "clobberold",     =
  -1 },=0A=
+    { "connect-timeout",            0,  OPT_VALUE,    "connecttimeout", =
  -1 },=0A=
+    { "continue",                  'c', OPT_BOOLEAN,  "continue",       =
  -1 },=0A=
+    { "convert-links",             'k', OPT_BOOLEAN,  "convertlinks",   =
  -1 },=0A=
+    { "cookies",                    0,  OPT_BOOLEAN,  "cookies",        =
  -1 },=0A=
+    { "cut-dirs",                   0,  OPT_VALUE,    "cutdirs",        =
  -1 },=0A=
+    { IF_DEBUG ("debug"),          'd', OPT_BOOLEAN,  "debug",          =
  -1 },=0A=
+    { "delete-after",               0,  OPT_BOOLEAN,  "deleteafter",    =
  -1 },=0A=
+    { "directories",                0,  OPT_BOOLEAN,  "dirstruct",      =
  -1 },=0A=
+    { "directory-prefix",          'P', OPT_VALUE,    "dirprefix",      =
  -1 },=0A=
+    { "dns-cache",                  0,  OPT_BOOLEAN,  "dnscache",       =
  -1 },=0A=
+    { "dns-timeout",                0,  OPT_VALUE,    "dnstimeout",     =
  -1 },=0A=
+    { "domains",                   'D', OPT_VALUE,    "domains",        =
  -1 },=0A=
+    { "dont-remove-listing",        0,  OPT__DONT_REMOVE_LISTING, NULL, =
no_argument },=0A=
+    { "dot-style",                  0,  OPT_VALUE,    "dotstyle",       =
  -1 },=0A=
+    { "egd-file",                   0,  OPT_VALUE,    "egdfile",        =
  -1 },=0A=
+    { "exclude-directories",       'X', OPT_VALUE,    =
"excludedirectories", -1 },=0A=
+    { "exclude-domains",            0,  OPT_VALUE,    "excludedomains", =
  -1 },=0A=
+    { "execute",                   'e', OPT__EXECUTE, NULL, =
required_argument },=0A=
+    { "follow-ftp",                 0,  OPT_BOOLEAN,  "followftp",      =
  -1 },=0A=
+    { "follow-tags",                0,  OPT_VALUE,    "followtags",     =
  -1 },=0A=
+    { "force-directories",         'x', OPT_BOOLEAN,  "dirstruct",      =
  -1 },=0A=
+    { "force-html",                'F', OPT_BOOLEAN,  "forcehtml",      =
  -1 },=0A=
+    { "ftp-password",               0,  OPT_VALUE,    "ftppassword",    =
  -1 },=0A=
+    { "ftp-user",                   0,  OPT_VALUE,    "ftpuser",        =
  -1 },=0A=
+    { "glob",                       0,  OPT_BOOLEAN,  "glob",           =
  -1 },=0A=
+    { "header",                     0,  OPT_VALUE,    "header",         =
  -1 },=0A=
+    { "help",                      'h', OPT_FUNCALL,  (void =
*)print_help, no_argument },=0A=
+    { "host-directories",           0,  OPT_BOOLEAN,  "addhostdir",     =
  -1 },=0A=
+    { "html-extension",            'E', OPT_BOOLEAN,  "htmlextension",  =
  -1 },=0A=
+    { "htmlify",                    0,  OPT_BOOLEAN,  "htmlify",        =
  -1 },=0A=
+    { "http-keep-alive",            0,  OPT_BOOLEAN,  "httpkeepalive",  =
  -1 },=0A=
+    { "http-passwd",                0,  OPT_VALUE,    "httppassword",   =
  -1 }, /* deprecated */=0A=
+    { "http-password",              0,  OPT_VALUE,    "httppassword",   =
  -1 },=0A=
+    { "http-user",                  0,  OPT_VALUE,    "httpuser",       =
  -1 },=0A=
+    { "ignore-length",              0,  OPT_BOOLEAN,  "ignorelength",   =
  -1 },=0A=
+    { "ignore-tags",                0,  OPT_VALUE,    "ignoretags",     =
  -1 },=0A=
+    { "include-directories",       'I', OPT_VALUE,    =
"includedirectories", -1 },=0A=
 #ifdef ENABLE_IPV6=0A=
-    { "inet4-only", '4', OPT_BOOLEAN, "inet4only", -1 },=0A=
-    { "inet6-only", '6', OPT_BOOLEAN, "inet6only", -1 },=0A=
+    { "inet4-only",                '4', OPT_BOOLEAN,  "inet4only",      =
  -1 },=0A=
+    { "inet6-only",                '6', OPT_BOOLEAN,  "inet6only",      =
  -1 },=0A=
 #endif=0A=
-    { "input-file", 'i', OPT_VALUE, "input", -1 },=0A=
-    { "keep-session-cookies", 0, OPT_BOOLEAN, "keepsessioncookies", -1 =
},=0A=
-    { "level", 'l', OPT_VALUE, "reclevel", -1 },=0A=
-    { "limit-rate", 0, OPT_VALUE, "limitrate", -1 },=0A=
-    { "load-cookies", 0, OPT_VALUE, "loadcookies", -1 },=0A=
-    { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 },=0A=
-    { "no", 'n', OPT__NO, NULL, required_argument },=0A=
-    { "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 },=0A=
-    { "no-parent", 0, OPT_BOOLEAN, "noparent", -1 },=0A=
-    { "output-document", 'O', OPT_VALUE, "outputdocument", -1 },=0A=
-    { "output-file", 'o', OPT_VALUE, "logfile", -1 },=0A=
-    { "page-requisites", 'p', OPT_BOOLEAN, "pagerequisites", -1 },=0A=
-    { "parent", 0, OPT__PARENT, NULL, optional_argument },=0A=
-    { "passive-ftp", 0, OPT_BOOLEAN, "passiveftp", -1 },=0A=
-    { "password", 0, OPT_VALUE, "password", -1 },=0A=
-    { "post-data", 0, OPT_VALUE, "postdata", -1 },=0A=
-    { "post-file", 0, OPT_VALUE, "postfile", -1 },=0A=
-    { "prefer-family", 0, OPT_VALUE, "preferfamily", -1 },=0A=
-    { "preserve-permissions", 0, OPT_BOOLEAN, "preservepermissions", -1 =
},=0A=
-    { IF_SSL ("private-key"), 0, OPT_VALUE, "privatekey", -1 },=0A=
-    { IF_SSL ("private-key-type"), 0, OPT_VALUE, "privatekeytype", -1 },=0A=
-    { "progress", 0, OPT_VALUE, "progress", -1 },=0A=
-    { "protocol-directories", 0, OPT_BOOLEAN, "protocoldirectories", -1 =
},=0A=
-    { "proxy", 0, OPT_BOOLEAN, "useproxy", -1 },=0A=
-    { "proxy__compat", 'Y', OPT_VALUE, "useproxy", -1 }, /* =
back-compatible */=0A=
-    { "proxy-passwd", 0, OPT_VALUE, "proxypassword", -1 }, /* =
deprecated */=0A=
-    { "proxy-password", 0, OPT_VALUE, "proxypassword", -1 },=0A=
-    { "proxy-user", 0, OPT_VALUE, "proxyuser", -1 },=0A=
-    { "quiet", 'q', OPT_BOOLEAN, "quiet", -1 },=0A=
-    { "quota", 'Q', OPT_VALUE, "quota", -1 },=0A=
-    { "random-file", 0, OPT_VALUE, "randomfile", -1 },=0A=
-    { "random-wait", 0, OPT_BOOLEAN, "randomwait", -1 },=0A=
-    { "read-timeout", 0, OPT_VALUE, "readtimeout", -1 },=0A=
-    { "recursive", 'r', OPT_BOOLEAN, "recursive", -1 },=0A=
-    { "referer", 0, OPT_VALUE, "referer", -1 },=0A=
-    { "reject", 'R', OPT_VALUE, "reject", -1 },=0A=
-    { "relative", 'L', OPT_BOOLEAN, "relativeonly", -1 },=0A=
-    { "remove-listing", 0, OPT_BOOLEAN, "removelisting", -1 },=0A=
-    { "restrict-file-names", 0, OPT_BOOLEAN, "restrictfilenames", -1 },=0A=
-    { "retr-symlinks", 0, OPT_BOOLEAN, "retrsymlinks", -1 },=0A=
-    { "retry-connrefused", 0, OPT_BOOLEAN, "retryconnrefused", -1 },=0A=
-    { "save-cookies", 0, OPT_VALUE, "savecookies", -1 },=0A=
-    { "save-headers", 0, OPT_BOOLEAN, "saveheaders", -1 },=0A=
-    { IF_SSL ("secure-protocol"), 0, OPT_VALUE, "secureprotocol", -1 },=0A=
-    { "server-response", 'S', OPT_BOOLEAN, "serverresponse", -1 },=0A=
-    { "span-hosts", 'H', OPT_BOOLEAN, "spanhosts", -1 },=0A=
-    { "spider", 0, OPT_BOOLEAN, "spider", -1 },=0A=
-    { "strict-comments", 0, OPT_BOOLEAN, "strictcomments", -1 },=0A=
-    { "timeout", 'T', OPT_VALUE, "timeout", -1 },=0A=
-    { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },=0A=
-    { "tries", 't', OPT_VALUE, "tries", -1 },=0A=
-    { "user", 0, OPT_VALUE, "user", -1 },=0A=
-    { "user-agent", 'U', OPT_VALUE, "useragent", -1 },=0A=
-    { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },=0A=
-    { "verbose", 0, OPT_BOOLEAN, "verbose", -1 },=0A=
-    { "version", 'V', OPT_FUNCALL, (void *) print_version, no_argument =
},=0A=
-    { "wait", 'w', OPT_VALUE, "wait", -1 },=0A=
-    { "waitretry", 0, OPT_VALUE, "waitretry", -1 },=0A=
+    { "input-file",                'i', OPT_VALUE,    "input",          =
  -1 },=0A=
+    { "keep-session-cookies",       0,  OPT_BOOLEAN,  =
"keepsessioncookies", -1 },=0A=
+    { "level",                     'l', OPT_VALUE,    "reclevel",       =
  -1 },=0A=
+    { "limit-rate",                 0,  OPT_VALUE,    "limitrate",      =
  -1 },=0A=
+    { "load-cookies",               0,  OPT_VALUE,    "loadcookies",    =
  -1 },=0A=
+    { "mirror",                    'm', OPT_BOOLEAN,  "mirror",         =
  -1 },=0A=
+    { "no",                        'n', OPT__NO,      NULL, =
required_argument },=0A=
+    { "no-clobber",                 0,  OPT_BOOLEAN,  "noclobber",      =
  -1 },=0A=
+    { "no-parent",                  0,  OPT_BOOLEAN,  "noparent",       =
  -1 },=0A=
+    { "no-redirects",               0,  OPT_BOOLEAN,  "noredirects",    =
  -1 },=0A=
+    { "no-https",                   0,  OPT_BOOLEAN,  "nohttps",        =
  -1 },=0A=
+    { "output-document",           'O', OPT_VALUE,    "outputdocument", =
  -1 },=0A=
+    { "output-file",               'o', OPT_VALUE,    "logfile",        =
  -1 },=0A=
+    { "page-requisites",           'p', OPT_BOOLEAN,  "pagerequisites", =
  -1 },=0A=
+    { "parent",                     0,  OPT__PARENT,  NULL, =
optional_argument },=0A=
+    { "passive-ftp",                0,  OPT_BOOLEAN,  "passiveftp",     =
  -1 },=0A=
+    { "password",                   0,  OPT_VALUE,    "password",       =
  -1 },=0A=
+    { "post-data",                  0,  OPT_VALUE,    "postdata",       =
  -1 },=0A=
+    { "post-file",                  0,  OPT_VALUE,    "postfile",       =
  -1 },=0A=
+    { "prefer-family",              0,  OPT_VALUE,    "preferfamily",   =
  -1 },=0A=
+    { "preserve-permissions",       0,  OPT_BOOLEAN,  =
"preservepermissions", -1 },=0A=
+    { IF_SSL ("private-key"),       0,  OPT_VALUE,    "privatekey",     =
  -1 },=0A=
+    { IF_SSL ("private-key-type"),  0,  OPT_VALUE,    "privatekeytype", =
  -1 },=0A=
+    { "progress",                   0,  OPT_VALUE,    "progress",       =
  -1 },=0A=
+    { "protocol-directories",       0,  OPT_BOOLEAN,  =
"protocoldirectories", -1 },=0A=
+    { "proxy",                      0,  OPT_BOOLEAN,  "useproxy",       =
  -1 },=0A=
+    { "proxy__compat",             'Y', OPT_VALUE,    "useproxy",       =
  -1 }, /* back-compatible */=0A=
+    { "proxy-passwd",               0,  OPT_VALUE,    "proxypassword",  =
  -1 }, /* deprecated */=0A=
+    { "proxy-password",             0,  OPT_VALUE,    "proxypassword",  =
  -1 },=0A=
+    { "proxy-user",                 0,  OPT_VALUE,    "proxyuser",      =
  -1 },=0A=
+    { "quiet",                     'q', OPT_BOOLEAN,  "quiet",          =
  -1 },=0A=
+    { "quota",                     'Q', OPT_VALUE,    "quota",          =
  -1 },=0A=
+    { "random-file",                0,  OPT_VALUE,    "randomfile",     =
  -1 },=0A=
+    { "random-wait",                0,  OPT_BOOLEAN,  "randomwait",     =
  -1 },=0A=
+    { "read-timeout",               0,  OPT_VALUE,    "readtimeout",    =
  -1 },=0A=
+    { "recursive",                 'r', OPT_BOOLEAN,  "recursive",      =
  -1 },=0A=
+    { "referer",                    0,  OPT_VALUE,    "referer",        =
  -1 },=0A=
+    { "reject",                    'R', OPT_VALUE,    "reject",         =
  -1 },=0A=
+    { "relative",                  'L', OPT_BOOLEAN,  "relativeonly",   =
  -1 },=0A=
+    { "remove-listing",             0,  OPT_BOOLEAN,  "removelisting",  =
  -1 },=0A=
+    { "restrict-file-names",        0,  OPT_BOOLEAN,  =
"restrictfilenames", -1 },=0A=
+    { "retr-symlinks",              0,  OPT_BOOLEAN,  "retrsymlinks",   =
  -1 },=0A=
+    { "retry-connrefused",          0,  OPT_BOOLEAN,  =
"retryconnrefused", -1 },=0A=
+    { "save-cookies",               0,  OPT_VALUE,    "savecookies",    =
  -1 },=0A=
+    { "save-headers",               0,  OPT_BOOLEAN,  "saveheaders",    =
  -1 },=0A=
+    { "save-headers-file",          0,  OPT_BOOLEAN,  =
"saveheaders2file", -1 },=0A=
+    { IF_SSL ("secure-protocol"),   0,  OPT_VALUE,    "secureprotocol", =
  -1 },=0A=
+    { "server-response",           'S', OPT_BOOLEAN,  "serverresponse", =
  -1 },=0A=
+    { "span-hosts",                'H', OPT_BOOLEAN,  "spanhosts",      =
  -1 },=0A=
+    { "spider",                     0,  OPT_BOOLEAN,  "spider",         =
  -1 },=0A=
+    { "strict-comments",            0,  OPT_BOOLEAN,  "strictcomments", =
  -1 },=0A=
+    { "timeout",                   'T', OPT_VALUE,    "timeout",        =
  -1 },=0A=
+    { "timestamping",              'N', OPT_BOOLEAN,  "timestamping",   =
  -1 },=0A=
+    { "tries",                     't', OPT_VALUE,    "tries",          =
  -1 },=0A=
+    { "user",                       0,  OPT_VALUE,    "user",           =
  -1 },=0A=
+    { "user-agent",                'U', OPT_VALUE,    "useragent",      =
  -1 },=0A=
+    { "verbose",                   'v', OPT_BOOLEAN,  "verbose",        =
  -1 },=0A=
+    { "verbose",                    0,  OPT_BOOLEAN,  "verbose",        =
  -1 },=0A=
+    { "version",                   'V', OPT_FUNCALL,  (void *) =
print_version, no_argument },=0A=
+    { "wvdat-ext",                  0,  OPT_BOOLEAN,  "extwvdat",       =
  -1 },=0A=
+    { "wait",                      'w', OPT_VALUE,    "wait",           =
  -1 },=0A=
+    { "waitretry",                  0,  OPT_VALUE,    "waitretry",      =
  -1 },=0A=
   };=0A=
 =0A=
 #undef IF_DEBUG=0A=
@@ -434,6 +439,8 @@=0A=
   -nc, --no-clobber              skip downloads that would download =
to\n\=0A=
                                  existing files.\n"),=0A=
     N_("\=0A=
+       --clobber-old             clobber existing files\n"),=0A=
+    N_("\=0A=
   -c,  --continue                resume getting a partially-downloaded =
file.\n"),=0A=
     N_("\=0A=
        --progress=3DTYPE           select progress gauge type.\n"),=0A=
@@ -472,6 +479,8 @@=0A=
        --no-dns-cache            disable caching DNS lookups.\n"),=0A=
     N_("\=0A=
        --restrict-file-names=3DOS  restrict chars in file names to ones =
OS allows.\n"),=0A=
+    N_("\=0A=
+       --wvdat-ext              append .wvdat to the file name.\n"),=0A=
 #ifdef ENABLE_IPV6=0A=
     N_("\=0A=
   -4,  --inet4-only              connect only to IPv4 addresses.\n"),=0A=
@@ -526,6 +535,8 @@=0A=
     N_("\=0A=
        --save-headers          save the HTTP headers to file.\n"),=0A=
     N_("\=0A=
+       --save-headers-file     save the HTTP headers to file with =
.wvhdr extension.\n"),=0A=
+    N_("\=0A=
   -U,  --user-agent=3DAGENT      identify as AGENT instead of =
Wget/VERSION.\n"),=0A=
     N_("\=0A=
        --no-http-keep-alive    disable HTTP keep-alive (persistent =
connections).\n"),=0A=
@@ -541,6 +552,8 @@=0A=
        --post-data=3DSTRING      use the POST method; send STRING as =
the data.\n"),=0A=
     N_("\=0A=
        --post-file=3DFILE        use the POST method; send contents of =
FILE.\n"),=0A=
+    N_("\=0A=
+       --no-redirects          don't follow redirects.\n"),=0A=
     "\n",=0A=
 =0A=
 #ifdef HAVE_SSL=0A=
@@ -567,6 +580,8 @@=0A=
        --random-file=3DFILE       file with random data for seeding the =
SSL PRNG.\n"),=0A=
     N_("\=0A=
        --egd-file=3DFILE          file naming the EGD socket with =
random data.\n"),=0A=
+    N_("\=0A=
+       --no-https               don't download any https docs.\n"),=0A=
     "\n",=0A=
 #endif /* HAVE_SSL */=0A=
 =0A=
diff -uNr wget-1.10.orig/src/options.h wget-1.10/src/options.h=0A=
--- wget-1.10.orig/src/options.h	Thu Apr 28 07:30:22 2005=0A=
+++ wget-1.10/src/options.h	Mon Aug  1 11:26:03 2005=0A=
@@ -53,6 +53,8 @@=0A=
   int protocol_directories;	/* Whether to prepend "http"/"ftp" to dirs. =
*/=0A=
   int noclobber;		/* Disables clobbering of existing=0A=
 				   data. */=0A=
+  int clobberold;               /* Enables clobbering of existing data =
*/=0A=
+=0A=
   char *dir_prefix;		/* The top of directory tree */=0A=
   char *lfilename;		/* Log filename */=0A=
   char *input_filename;		/* Input filename */=0A=
@@ -123,6 +125,8 @@=0A=
   int server_response;		/* Do we print server response? */=0A=
   int save_headers;		/* Do we save headers together with=0A=
 				   file? */=0A=
+  int save_headers2file;        /* Do we save headers into another file=0A=
+                                   with a .wvhdr extension */=0A=
 =0A=
 #ifdef ENABLE_DEBUG=0A=
   int debug;			/* Debugging on/off */=0A=
@@ -206,8 +210,12 @@=0A=
   int strict_comments;		/* whether strict SGML comments are=0A=
 				   enforced.  */=0A=
 =0A=
-  int preserve_perm;           /* whether remote permissions are used=0A=
-				  or that what is set by umask. */=0A=
+  int preserve_perm;            /* whether remote permissions are used=0A=
+                                   or that what is set by umask. */=0A=
+=0A=
+  int extwvdat;                 /* Add .wvdat to the file name */=0A=
+  int no_redirects;             /* Don't follow redirects */=0A=
+  int no_https;                 /* Don't retrieve https documents */=0A=
 =0A=
 #ifdef ENABLE_IPV6=0A=
   int ipv4_only;		/* IPv4 connections have been requested. */=0A=
@@ -217,8 +225,8 @@=0A=
     prefer_ipv4,=0A=
     prefer_ipv6,=0A=
     prefer_none=0A=
-  } prefer_family;		/* preferred address family when more=0A=
-				   than one type is available */=0A=
+  } prefer_family;		/* preferred address family when more */=0A=
+=0A=
 };=0A=
 =0A=
 extern struct options opt;=0A=
diff -uNr wget-1.10.orig/src/retr.c wget-1.10/src/retr.c=0A=
--- wget-1.10.orig/src/retr.c	Thu May  5 19:48:08 2005=0A=
+++ wget-1.10/src/retr.c	Mon Aug  1 15:51:21 2005=0A=
@@ -630,6 +630,11 @@=0A=
 =0A=
  redirected:=0A=
 =0A=
+ /*=0A=
+  * No https=0A=
+  */=0A=
+  if (opt.no_https) if (u->scheme =3D=3D SCHEME_HTTPS) return WRONGCODE;=0A=
+=0A=
   result =3D NOCONERROR;=0A=
   mynewloc =3D NULL;=0A=
   local_file =3D NULL;=0A=
@@ -745,6 +750,20 @@=0A=
 	  return WRONGCODE;=0A=
 	}=0A=
 =0A=
+     /*=0A=
+      * Stop following any redirects!=0A=
+      */=0A=
+      if (opt.no_redirects)=0A=
+      {=0A=
+        logprintf (LOG_NOTQUIET, "Redirect forbidden --no-redirects is =
active.\n");=0A=
+        url_free (newloc_parsed);=0A=
+        url_free (u);=0A=
+        xfree (url);=0A=
+        xfree (mynewloc);=0A=
+        RESTORE_POST_DATA;=0A=
+        return WRONGCODE;=0A=
+      }=0A=
+=0A=
       xfree (url);=0A=
       url =3D mynewloc;=0A=
       url_free (u);=0A=
diff -uNr wget-1.10.orig/src/url.c wget-1.10/src/url.c=0A=
--- wget-1.10.orig/src/url.c	Tue May 31 04:44:20 2005=0A=
+++ wget-1.10/src/url.c	Mon Aug  1 11:26:15 2005=0A=
@@ -1502,6 +1502,8 @@=0A=
       && !(file_exists_p (fname) && !file_non_directory_p (fname)))=0A=
     return fname;=0A=
 =0A=
+  if (opt.clobberold) return fname;=0A=
+=0A=
   unique =3D unique_name (fname, 1);=0A=
   if (unique !=3D fname)=0A=
     xfree (fname);=0A=

------=_NextPart_000_0082_01C596B5.C10ED970--