From e62aa1dd8099aeb8bb667253ca22c56b93f521d1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jan 2014 23:02:51 +0100 Subject: pkgTagFile: if we have seen the end, do not try to see more Asking for more via Step() will notice that we are done with the file already and will result in a fail, which means we can't find the last sections anymore (which is especially painful if we haven't moved at all as in the testcase we haven't even looked at one of the sources leading to a strange behaviour) Reported-By: Niall Walsh --- apt-pkg/tagfile.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt-pkg/tagfile.cc') diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index b92b2c15a..832a40d1e 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -207,7 +207,11 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) unsigned long long Dist = Offset - d->iOffset; d->Start += Dist; d->iOffset += Dist; - return Step(Tag); + // if we have seen the end, don't ask for more + if (d->Done == true) + return Tag.Scan(d->Start, d->End - d->Start); + else + return Step(Tag); } // Reposition and reload.. -- cgit v1.2.3