]> sjero.net Git - wget/commitdiff
[svn] Remove output document in case of download problems when -O and --quiet are...
authormtortonesi <devnull@localhost>
Tue, 24 Jan 2006 13:36:24 +0000 (05:36 -0800)
committermtortonesi <devnull@localhost>
Tue, 24 Jan 2006 13:36:24 +0000 (05:36 -0800)
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.  */