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.
- virtual bool Restart() {return Tags.Jump(Sect,0);};
+ virtual bool Restart() {return Jump(0);};
virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
virtual bool Jump(unsigned long const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);};
virtual bool Jump(unsigned long const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);};
virtual bool Files(std::vector<pkgSrcRecords::File> &F);
debSrcRecordParser(std::string const &File,pkgIndexFile const *Index)
virtual bool Files(std::vector<pkgSrcRecords::File> &F);
debSrcRecordParser(std::string const &File,pkgIndexFile const *Index)
- : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400),
- Buffer(NULL) {}
+ : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400),
+ iOffset(0), Buffer(NULL) {}
virtual ~debSrcRecordParser();
};
virtual ~debSrcRecordParser();
};
Current = Files.begin();
for (std::vector<Parser*>::iterator I = Files.begin();
I != Files.end(); ++I)
Current = Files.begin();
for (std::vector<Parser*>::iterator I = Files.begin();
I != Files.end(); ++I)
+ if ((*I)->Offset() != 0)
+ (*I)->Restart();
+