]> git.saurik.com Git - apt.git/blobdiff - methods/gzip.cc
* apt-pkg/deb/dpkgpm.cc:
[apt.git] / methods / gzip.cc
index fc4e1ecfd68c93cb9824ac74a7a6a3d2eadd662d..6ab6548efb56f82edea77f4de17763e14d3c2953 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>
@@ -39,14 +41,14 @@ class GzipMethod : public pkgAcqMethod
 bool GzipMethod::Fetch(FetchItem *Itm)
 {
    URI Get = Itm->Uri;
-   string Path = Get.Host + Get.Path; // To account for relative paths
+   std::string Path = Get.Host + Get.Path; // To account for relative paths
    
    FetchResult Res;
    Res.Filename = Itm->DestFile;
    URIStart(Res);
    
    // Open the source and destination files
-   FileFd From(Path,FileFd::ReadOnlyGzip);
+   FileFd From(Path,FileFd::ReadOnly, FileFd::Gzip);
 
    if(From.FileSize() == 0)
       return _error->Error(_("Empty files can't be valid archives"));
@@ -62,7 +64,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
    while (1) 
    {
       unsigned char Buffer[4*1024];
-      unsigned long Count;
+      unsigned long long Count = 0;
       
       if (!From.Read(Buffer,sizeof(Buffer),&Count))
       {