X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/7c122f33c4bf8caec1cf8b250d512b65c3c574ca..cbea0578989754f70874bf49946b84bf4f7a567e:/methods/bzip2.cc diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 241f21c66..42932dded 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -56,12 +56,8 @@ bool Bzip2Method::Fetch(FetchItem *Itm) // Open the source and destination files FileFd From(Path,FileFd::ReadOnly); - // if the file is empty, just rename it and return - if(From.Size() == 0) - { - rename(Path.c_str(), Itm->DestFile.c_str()); - return true; - } + if(From.FileSize() == 0) + return _error->Error(_("Empty files can't be valid archives")); int GzOut[2]; if (pipe(GzOut) < 0)