From dd80692a89481eeff56ebcb1f5be9edf179ca766 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 28 Nov 2020 21:56:54 +0100 Subject: [PATCH] Fix writing of the configuration block. --- database-builder.cpp | 4 ++-- updatedb.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/database-builder.cpp b/database-builder.cpp index af688cf..fdd637a 100644 --- a/database-builder.cpp +++ b/database-builder.cpp @@ -597,8 +597,8 @@ void DatabaseBuilder::finish_corpus() // And the configuration block. if (!conf_block.empty()) { - hdr.next_zstd_dictionary_offset_bytes = ftell(outfp); - hdr.next_zstd_dictionary_length_bytes = conf_block.size(); + hdr.conf_block_offset_bytes = ftell(outfp); + hdr.conf_block_length_bytes = conf_block.size(); fwrite(conf_block.data(), conf_block.size(), 1, outfp); } diff --git a/updatedb.cpp b/updatedb.cpp index 6596ca1..f655aa3 100644 --- a/updatedb.cpp +++ b/updatedb.cpp @@ -763,6 +763,7 @@ int main(int argc, char **argv) } DatabaseBuilder db(conf_output.c_str(), owner, conf_block_size, existing_db.read_next_dictionary()); + db.set_conf_block(conf_block); Corpus *corpus = db.start_corpus(/*store_dir_times=*/true); int root_fd = opendir_noatime(AT_FDCWD, conf_scan_root); -- 2.39.2