X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b472c6b08e0bfd1ea94390cd525cef579ea3ccee..9b78cda6873104b80ffdbc8b5d3965575ce0a31d:/methods/gzip.cc diff --git a/methods/gzip.cc b/methods/gzip.cc index 5b9b66b50..f1c76066e 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -48,12 +48,9 @@ bool GzipMethod::Fetch(FetchItem *Itm) // Open the source and destination files FileFd From(Path,FileFd::ReadOnlyGzip); - // if the file is empty, just rename it and return - if(From.Size() == 0) - { - rename(Path.c_str(), Itm->DestFile.c_str()); - return true; - } + // FIXME add an error message saying that empty files can't be valid archives + if(From.FileSize() == 0) + return false; FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure();