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

miniz file index inconsistency #295

Open
Bilal2453 opened this issue Aug 21, 2024 · 0 comments
Open

miniz file index inconsistency #295

Bilal2453 opened this issue Aug 21, 2024 · 0 comments

Comments

@Bilal2453
Copy link
Contributor

Take the following ZIP file structure, which consists of one file:

./dir
└── test.lua

If you try out the following code:

local miniz = require("miniz")
local reader = miniz.new_reader("dir.zip")

local stats = reader:stat(1) -- our only file in this central directory
assert(stats.index == 1)

The above assertion will fail, because while lminiz accepts a 1-based index of the file, it internally subtracts one, and then never adds that one back to any output. This applies to errors too:
image

This issue is more of a question, @zhaozg is lminiz supposed to be transparent about the difference in index or is the current behavior the expected one?

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

1 participant