ckolivas / lrzip

Long Range Zip
http://lrzip.kolivas.org
GNU General Public License v2.0
618 stars 76 forks source link

lrzip -vvi shows incorrect offset for stream 1 #212

Closed pete4abw closed 3 years ago

pete4abw commented 3 years ago

Examining the output of max verbose lrzip -vvi revealed that the offset shown for stream 1 is incorrect. It uses the same offset as stream 0. This occurs for all chunks. I believe this oversight has been around since

a023420 2011-03-13  Make get_filefinfo read over whole file to get uncompressed size for when it's not known due to being a stdout chunked file. Don't display microseconds in information as it will be removed.

I don't maintain a fork of lrzip anymore, but this patch will help. It is implemented in lrzip-next.

Patch

diff --git a/lrzip.c b/lrzip.c
index f938a1b..0133c90 100644
--- a/lrzip.c
+++ b/lrzip.c
@@ -1054,7 +1054,7 @@ next_chunk:
                        return false;

                print_verbose("Stream: %d\n", stream);
-               print_maxverbose("Offset: %lld\n", ofs);
+               print_maxverbose("Offset: %lld\n", stream_head[stream] + ofs);
                print_verbose("Block\tComp\tPercent\tSize\n");
                do {
                        i64 head_off;

Current

Detected lrzip version 0.6 file. Rzip chunk 1: Chunk byte width: 5 Chunk size: 11038134272 Stream: 0 Offset: 31 Block Comp Percent Size 1 lzma 53.4% 6529796 / 12220318 Offset: 3349071800 Head: 0 Stream: 1 Offset: 31 Block Comp Percent Size 1 lzma 29.2% 86822316 / 297431647 Offset: 63 Head: 86822364

Patched

Detected lrzip version 0.6 file. Rzip chunk 1: Chunk byte width: 5 Chunk size: 11038134272 Stream: 0 Offset: 31 Block Comp Percent Size 1 lzma 53.4% 6529796 / 12220318 Offset: 3349071800 Head: 0 Stream: 1 Offset: 47 Block Comp Percent Size 1 lzma 29.2% 86822316 / 297431647 Offset: 63 Head: 86822364

ckolivas commented 3 years ago

Applied, thanks.