1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Remove output document in case of download problems when -O and --quiet are given.

This commit is contained in:
mtortonesi 2006-01-24 05:36:24 -08:00
parent 4ad743db98
commit f1b726490e

View File

@ -1427,7 +1427,15 @@ cleanup (void)
/* Free external resources, close files, etc. */ /* Free external resources, close files, etc. */
if (output_stream) 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 /* No need to check for error because Wget flushes its output (and
checks for errors) after any data arrives. */ checks for errors) after any data arrives. */