X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6802b90c0871726f0018b2c3c059bf8c95a4a710..eb3947c6510042c054a319d8053821faf7244dea:/methods/bzip2.cc?ds=sidebyside diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 241f21c66..ccc3669a2 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -56,12 +56,9 @@ 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; - } + // FIXME add an error message saying that empty files can't be valid archives + if(From.FileSize() == 0) + return false; int GzOut[2]; if (pipe(GzOut) < 0)