Revert "Store block last offset instead of block size"
commitfb6f00d1e6e0f63a5423e3ee1120224c81e8b3ca
authorPetr Tesarik <petr@tesarici.cz>
Fri, 18 May 2018 07:21:24 +0000 (18 09:21 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Fri, 18 May 2018 07:29:04 +0000 (18 09:29 +0200)
tree6c2bb8a8074ccc38eb33fbd068b766bfc0a43450
parentce21e3f0350d7e46905c1716ed8180f90bff879a
Revert "Store block last offset instead of block size"

This reverts commit d0ec586c02c441b352efb1ec763270e84335f5ca.

It turns out that using max offset instead of size was a bad idea.
Among other things that broke, tree search may return a zero-sized
insert block at offset 0 for any position, because its size is -1,
which overflows to UOFF_MAX, so it appears to be a block that covers
all possible file positions...

Of course, this change breaks handling of (UOFF_MAX+1)-sized blocks,
but that will be much easier to fix.

Signed-off-by: Petr Tesarik <petr@tesarici.cz>
libhed/file.c
libhed/file.h
libhed/tree.c
libhed/types.h