summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debrecords.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2015-08-18 11:57:35 +0200
committerMichael Vogt <mvo@debian.org>2015-08-18 11:57:35 +0200
commitb53c9cea2902572822bbbece5bac236c1bbf846e (patch)
tree6c6b0524e0971c0623ccbff71383523ee0b2a5cc /apt-pkg/deb/debrecords.cc
parent21248c0f00ee71412dbadc6ebf84011cf974346d (diff)
parent2a22cd60f04c4291ea9b9b72e15b6d2ec378b001 (diff)
Merge remote-tracking branch 'upstream/debian/experimental' into feature/srv-records
Diffstat (limited to 'apt-pkg/deb/debrecords.cc')
-rw-r--r--apt-pkg/deb/debrecords.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc
index 335bcfda0..d78a7e2e0 100644
--- a/apt-pkg/deb/debrecords.cc
+++ b/apt-pkg/deb/debrecords.cc
@@ -34,7 +34,7 @@ using std::string;
// RecordParser::debRecordParser - Constructor /*{{{*/
debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
- debRecordParserBase(), File(FileName, FileFd::ReadOnly, FileFd::Extension),
+ debRecordParserBase(), d(NULL), File(FileName, FileFd::ReadOnly, FileFd::Extension),
Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200)
{
}
@@ -42,15 +42,20 @@ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) :
// RecordParser::Jump - Jump to a specific record /*{{{*/
bool debRecordParser::Jump(pkgCache::VerFileIterator const &Ver)
{
+ if (Ver.end() == true)
+ return false;
return Tags.Jump(Section,Ver->Offset);
}
bool debRecordParser::Jump(pkgCache::DescFileIterator const &Desc)
{
+ if (Desc.end() == true)
+ return false;
return Tags.Jump(Section,Desc->Offset);
}
/*}}}*/
debRecordParser::~debRecordParser() {}
+debRecordParserBase::debRecordParserBase() : Parser(), d(NULL) {}
// RecordParserBase::FileName - Return the archive filename on the site /*{{{*/
string debRecordParserBase::FileName()
{
@@ -207,3 +212,9 @@ bool debDebFileRecordParser::LoadContent()
return _error->Error(_("Unable to parse package file %s (%d)"), debFileName.c_str(), 3);
return true;
}
+bool debDebFileRecordParser::Jump(pkgCache::VerFileIterator const &) { return LoadContent(); }
+bool debDebFileRecordParser::Jump(pkgCache::DescFileIterator const &) { return LoadContent(); }
+std::string debDebFileRecordParser::FileName() { return debFileName; }
+
+debDebFileRecordParser::debDebFileRecordParser(std::string FileName) : debRecordParserBase(), d(NULL), debFileName(FileName) {}
+debDebFileRecordParser::~debDebFileRecordParser() {}