summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-01-29 23:02:51 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-01-30 00:16:19 +0100
commite62aa1dd8099aeb8bb667253ca22c56b93f521d1 (patch)
tree4b69ca1552e7c95b31b9a412a9e73c6b5c1c95ce /apt-pkg
parentbae81c1307e956aa8928c9d6a77830fb733cd61f (diff)
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 <niallwalsh@users.berlios.de>
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/tagfile.cc6
1 files changed, 5 insertions, 1 deletions
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..