Fix block insertion in replace_chunk
commit91133a1207fb03a95f322dda235303cc9d613a8c
authorPetr Tesarik <petr@tesarici.cz>
Tue, 9 Oct 2012 06:53:19 +0000 (9 08:53 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Tue, 9 Oct 2012 06:53:19 +0000 (9 08:53 +0200)
tree6e9f29c89762e48bdb68101d84acbed84358c13a
parent149984523a6b4c6fb289bcbd7823da78f8ebc2b3
Fix block insertion in replace_chunk

The code in replace_chunk() may try to add a tail block at the end
of the tree if you call it on the EOF block and the tail block has
to be re-created. This breaks the assumption of the tree code that
the last block never changes, and after changing the semantics of
insert_into_tree(), it will even add the tail block at the wrong
place (at the beginning of the tree).

Solve it by re-creating a head block instead.
libhed/file.c