From 0ab5ae44a7d351b77e5f4282294788c3505a8336 Mon Sep 17 00:00:00 2001 From: Konstantin Isakov Date: Mon, 23 Jan 2012 20:59:16 -0800 Subject: [PATCH] Fix a problem with zip archive indexing where files with similar names could clash. --- btreeidx.cc | 8 ++------ dsl.cc | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/btreeidx.cc b/btreeidx.cc index 8daebf1a..3a2cbcc5 100644 --- a/btreeidx.cc +++ b/btreeidx.cc @@ -968,12 +968,8 @@ void IndexedWords::addWord( wstring const & word, uint32_t articleOffset ) void IndexedWords::addSingleWord( wstring const & word, uint32_t articleOffset ) { - vector< WordArticleLink > links( 1, WordArticleLink( Utf8::encode( word ), - articleOffset ) ); - - insert( - IndexedWords::value_type( - Utf8::encode( Folding::apply( word ) ), links ) ); + operator []( Utf8::encode( Folding::apply( word ) ) ).push_back( + WordArticleLink( Utf8::encode( word ), articleOffset ) ); } IndexInfo buildIndex( IndexedWords const & indexedWords, File::Class & file ) diff --git a/dsl.cc b/dsl.cc index fea20d15..a605cfcf 100644 --- a/dsl.cc +++ b/dsl.cc @@ -71,7 +71,7 @@ enum { Signature = 0x584c5344, // DSLX on little-endian, XLSD on big-endian CurrentFormatVersion = 14 + BtreeIndexing::FormatVersion + Folding::Version, - CurrentZipSupportVersion = 1 + CurrentZipSupportVersion = 2 }; struct IdxHeader