From: Steinar H. Gunderson Date: Sat, 28 Nov 2020 20:56:54 +0000 (+0100) Subject: Fix writing of the configuration block. X-Git-Tag: 1.1.0~11 X-Git-Url: https://git.sesse.net/?p=plocate;a=commitdiff_plain;h=dd80692a89481eeff56ebcb1f5be9edf179ca766 Fix writing of the configuration block. --- 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);