Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lrzip -vvi shows incorrect offset for stream 1 #212

Closed
pete4abw opened this issue Nov 15, 2021 · 1 comment
Closed

lrzip -vvi shows incorrect offset for stream 1 #212

pete4abw opened this issue Nov 15, 2021 · 1 comment

Comments

@pete4abw
Copy link
Contributor

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
Copy link
Owner

Applied, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants