]> git.sesse.net Git - plocate/commitdiff
Fix writing of the configuration block.
authorSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 28 Nov 2020 20:56:54 +0000 (21:56 +0100)
committerSteinar H. Gunderson <steinar+git@gunderson.no>
Sat, 28 Nov 2020 20:56:54 +0000 (21:56 +0100)
database-builder.cpp
updatedb.cpp

index af688cf78186886d71507b95fdc26b6ca27bc2ca..fdd637a059f05bee47be8a90367cb3f30d137faf 100644 (file)
@@ -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);
        }
 
index 6596ca1c141983f976a479ede399f307037a2ffc..f655aa33fe6b80468b17b81c59f732594af3a7dc 100644 (file)
@@ -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);