]> git.saurik.com Git - apt.git/blobdiff - methods/gzip.cc
reorder includes: add <config.h> if needed and include it at first
[apt.git] / methods / gzip.cc
index 22cae94244b62e067717d9a2cdf77b832ed07ef7..6202d73dc29f71c00c8db8ae2f369b041780f468 100644 (file)
@@ -9,6 +9,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/acquire-method.h>
@@ -48,9 +50,8 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    // Open the source and destination files
    FileFd From(Path,FileFd::ReadOnlyGzip);
 
-   // FIXME add an error message saying that empty files can't be valid archives
-   if(From.Size() == 0)
-      return false;
+   if(From.FileSize() == 0)
+      return _error->Error(_("Empty files can't be valid archives"));
 
    FileFd To(Itm->DestFile,FileFd::WriteAtomic);   
    To.EraseOnFailure();