]> sjero.net Git - wget/blobdiff - src/init.c
[svn] * retr.c (fd_read_body): Report the amount of data *written* as
[wget] / src / init.c
index b48a57c13aa7eb4ff7a60b792237947577b2607e..8624f128e17f987ef5a22e65e37f33532c733418 100644 (file)
@@ -1284,8 +1284,13 @@ cleanup (void)
 {
   /* Free external resources, close files, etc. */
 
-  if (opt.dfp)
-    fclose (opt.dfp);
+  {
+    extern FILE *output_stream;
+    if (output_stream)
+      fclose (output_stream);
+    /* No need to check for error because Wget flushes its output (and
+       checks for errors) after any data arrives.  */
+  }
 
   /* We're exiting anyway so there's no real need to call free()
      hundreds of times.  Skipping the frees will make Wget exit