http://bugs.openzim.org/show_bug.cgi?id=33
Summary: file::findxByTitle() fails Product: openZIM Version: unspecified Platform: PC OS/Version: Linux Status: NEW Severity: major Priority: P5 Component: zimlib AssignedTo: tommi@tntnet.org ReportedBy: emmanuel@engelhart.org CC: dev-l@openzim.org Estimated Hours: 0.0
It seems that zimlib file::findxByTitle() always returns an good result iterator which is deincremented of one (so always wrong).
code: === std::pair<bool, zim::File::const_iterator> resultPair = zimFileHandler->findxByTitle('A', title); if (resultPair.first == true) { zim::Article article = zimFileHandler->getArticle(resultPair.second.getIndex()+1); } ===
code with workaround: === std::pair<bool, zim::File::const_iterator> resultPair = zimFileHandler->findxByTitle('A', title); if (resultPair.first == true) { zim::Article article = zimFileHandler->getArticle(resultPair.second.getIndex()+1); } ===