Skip to content

Conversation

@sjoblomj
Copy link
Contributor

@sjoblomj sjoblomj commented Nov 28, 2025

Turns out that in PR #117 / #118, I introduced a regression. If you try to use mpqcli list -ad on an archive with unknown filenames in it, it will list each unknown file 32 times. This PR fixes the bug. 🙈

Also adding tests for the list and extract command (basically adding tests for the code I added in #31, but back then there was no test suite).

In this PR is an MPQ without an internal listfile, for use by the tests. I don't know if you find bundling an MPQ like this to be an issue or not; I realize the other tests create or download MPQs as needed, but the only way to create an MPQ without internal listfiles involves changing the code to use SFileCreateArchive2 instead of SFileCreateArchive. We thus can't create one from the tests on-the-fly. The alternative I guess would be to try to find a public stable URL with a small MPQ with no internal listfile, but I opted to spend my time on other things than search for such a thing. 🙃

@thomaslaurenson thomaslaurenson merged commit f81359d into TheGrayDot:main Dec 23, 2025
11 checks passed
@thomaslaurenson
Copy link
Collaborator

Thanks for the PR. Sorry for taking so long to merge. I am also putting together a release PR to bundle this fix, and the locales PRs.

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

Successfully merging this pull request may close these issues.

2 participants