From 6a9c9d63edc878ff268cdaa4f985ca50c48380b0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 29 Jan 2014 23:24:41 +0100 Subject: restart debSrcRecordParsers only if needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The offset variable in DebSrcRecordParser was not initialized which we now do and based on it do not trigger a restart if the parser was not used yet avoiding a needless rescan of the section. Detected while working on the previous commit e62aa1dd. Both commits act as a "fix" for the bug shown in the testcase of the commit – this one here would only hide it through. --- apt-pkg/srcrecords.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apt-pkg/srcrecords.cc') diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 297559957..60b62850a 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -70,8 +70,9 @@ bool pkgSrcRecords::Restart() Current = Files.begin(); for (std::vector::iterator I = Files.begin(); I != Files.end(); ++I) - (*I)->Restart(); - + if ((*I)->Offset() != 0) + (*I)->Restart(); + return true; } /*}}}*/ -- cgit v1.2.3