mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 00:38:31 +00:00
Let lz4toasm accept LZ4 files that lack extracted-size field (#858)
lz4toasm should now more easily accept LZ4 files output by compressor programs that do not support the extracted-size field, such as Stephan Brumme's smallz4. This patch also proposes to add a new lz4len() function to the libc: it parses an LZ4 compressed block to compute the unpacked content size, without really unpacking the block. Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
parent
3eec69f9c3
commit
0ffc0dd461
3 changed files with 59 additions and 2 deletions
|
@ -116,8 +116,7 @@ int main(int argc, char *argv[]) {
|
|||
if (LZ4_FRAME_BLOCKCONTENTSIZEFLAG(frame)) {
|
||||
extractedsize = LZ4_FRAME_BLOCKCONTENTSIZE(frame);
|
||||
} else {
|
||||
fprintf(stderr, "error: need extractedsize\n");
|
||||
exit(1);
|
||||
extractedsize = lz4len(data, size);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue