summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-03-22 10:05:59 +0000
committerJulian Andres Klode <jak@debian.org>2024-03-22 10:05:59 +0000
commit145464cb059d088999280ddc8f808da4d29873ee (patch)
tree92f91edd8bc614c0f7fc62b326c2ca4dff380bb9
parent92dfc56a541894e293019920fe9031ae4d42fb29 (diff)
parent88e55d1b7237e6c3b5689b7ce154ef98b11fbf74 (diff)
Merge branch 'tagfile-lookback' into 'main'
pkgTagFile::Jump: Use lookback buffer to rejump to current position See merge request apt-team/apt!336
-rw-r--r--apt-pkg/tagfile.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 8f323bb5a..95ae4a483 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -431,6 +431,11 @@ bool pkgTagFile::Fill()
that is there */
bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset)
{
+ // Head back to the start of the buffer, in case we get called for the same section
+ // again (d->Start will point to next section already)
+ d->iOffset -= d->Start - d->Buffer;
+ d->Start = d->Buffer;
+
if ((d->Flags & pkgTagFile::SUPPORT_COMMENTS) == 0 &&
// We are within a buffer space of the next hit..
Offset >= d->iOffset && d->iOffset + (d->End - d->Start) > Offset)