]> 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 820f84dbd31165868ee9ab1c7be1c601ed7c98b3..26b52a5793b1bdf6e244a0e0fc5b3068b428471f 100644 (file)
@@ -1427,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.  */