]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/indexrecords.cc
merged r1970 lp:~vorlon/apt/lp.968828
[apt.git] / apt-pkg / indexrecords.cc
index 448a76c27eea7dd1945bd28a490aeac9d586f1a8..af2639beb851cfb125bf84b072c9aab2109e4daf 100644 (file)
 #include <apt-pkg/error.h>
 #include <apt-pkg/strutl.h>
 #include <apt-pkg/configuration.h>
+#include <apt-pkg/fileutl.h>
+#include <apt-pkg/hashes.h>
+
 #include <sys/stat.h>
 #include <clocale>
 
 #include <apti18n.h>
                                                                        /*}}}*/
+
+using std::string;
+
 string indexRecords::GetDist() const
 {
    return this->Dist;
@@ -38,7 +44,10 @@ time_t indexRecords::GetValidUntil() const
 
 const indexRecords::checkSum *indexRecords::Lookup(const string MetaKey)
 {
-   return Entries[MetaKey];
+   std::map<std::string, indexRecords::checkSum* >::const_iterator sum = Entries.find(MetaKey);
+   if (sum == Entries.end())
+      return NULL;
+   return sum->second;
 }
 
 bool indexRecords::Exists(string const &MetaKey) const
@@ -146,7 +155,7 @@ bool indexRecords::Load(const string Filename)                              /*{{{*/
    return true;
 }
                                                                        /*}}}*/
-vector<string> indexRecords::MetaKeys()                                        /*{{{*/
+std::vector<string> indexRecords::MetaKeys()                           /*{{{*/
 {
    std::vector<std::string> keys;
    std::map<string,checkSum *>::iterator I = Entries.begin();