]> sjero.net Git - wget/blobdiff - src/init.c
[svn] Remove output document in case of download problems when -O and --quiet are...
[wget] / src / init.c
index 097a2bfc2f00637d904df1ad81eabe1d5780f28d..26b52a5793b1bdf6e244a0e0fc5b3068b428471f 100644 (file)
@@ -1,5 +1,5 @@
 /* Reading/parsing the initialization file.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996-2005 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -14,8 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with Wget; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+along with Wget; if not, write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 
 In addition, as a special exception, the Free Software Foundation
 gives permission to link the code of its release of Wget with the
@@ -163,6 +163,7 @@ static struct {
   { "httpproxy",       &opt.http_proxy,        cmd_string },
   { "httpsproxy",      &opt.https_proxy,       cmd_string },
   { "httpuser",                &opt.http_user,         cmd_string },
+  { "ignorecase",      &opt.ignore_case,       cmd_boolean },
   { "ignorelength",    &opt.ignore_length,     cmd_boolean },
   { "ignoretags",      &opt.ignore_tags,       cmd_vector },
   { "includedirectories", &opt.includes,       cmd_directory_vector },
@@ -172,7 +173,6 @@ static struct {
 #endif
   { "input",           &opt.input_filename,    cmd_file },
   { "keepsessioncookies", &opt.keep_session_cookies, cmd_boolean },
-  { "killlonger",      &opt.kill_longer,       cmd_boolean },
   { "limitrate",       &opt.limit_rate,        cmd_bytes },
   { "loadcookies",     &opt.cookies_input,     cmd_file },
   { "logfile",         &opt.lfilename,         cmd_file },
@@ -1388,7 +1388,8 @@ check_user_specified_header (const char *s)
 {
   const char *p;
 
-  for (p = s; *p && *p != ':' && !ISSPACE (*p); p++);
+  for (p = s; *p && *p != ':' && !ISSPACE (*p); p++)
+    ;
   /* The header MUST contain `:' preceded by at least one
      non-whitespace character.  */
   if (*p != ':' || p == s)
@@ -1426,7 +1427,15 @@ cleanup (void)
   /* Free external resources, close files, etc. */
 
   if (output_stream)
-    fclose (output_stream);
+    {
+      fclose (output_stream);
+      if (opt.output_document 
+          && !(total_downloaded_bytes > 0))
+        {
+          unlink (opt.output_document);
+        }
+    }
+  
   /* No need to check for error because Wget flushes its output (and
      checks for errors) after any data arrives.  */