]> git.saurik.com Git - apt.git/blobdiff - methods/gzip.cc
merged from the debian branch
[apt.git] / methods / gzip.cc
index 5b9b66b50375769f1d528b11c00d116c03e0841d..fc4e1ecfd68c93cb9824ac74a7a6a3d2eadd662d 100644 (file)
@@ -48,12 +48,8 @@ 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;
-   }
+   if(From.FileSize() == 0)
+      return _error->Error(_("Empty files can't be valid archives"));
 
    FileFd To(Itm->DestFile,FileFd::WriteAtomic);   
    To.EraseOnFailure();