From eb16edb9084024acb2ac50b5cdbee4f4d6c0242c Mon Sep 17 00:00:00 2001 From: Petr Tesarik Date: Tue, 2 Oct 2012 22:38:25 +0200 Subject: [PATCH] Fix final shrinking of insert blocks If there is removed data at the beginning, it must still be counted in for the data object size. --- libhed/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libhed/file.c b/libhed/file.c index dc00424..5329aa5 100644 --- a/libhed/file.c +++ b/libhed/file.c @@ -1716,7 +1716,8 @@ hed_file_insert_end(struct hed_file *file, blockoff_t *blockoff_ins) blockoff_ins->block = NULL; list_del(&blockoff_ins->list); if (!kill_block_if_empty(file, block)) - block_data_shrink(file->cache, block->dataobj, block->t.size); + block_data_shrink(file->cache, block->dataobj, + block->dataoff + block->t.size); dump_blocks(file); } -- 2.11.4.GIT