Skip to content

miniz file index inconsistency  #295

Open
@Bilal2453

Description

@Bilal2453

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions