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

Fix argument parsing for inflate() #39

Merged
merged 1 commit into from
Oct 7, 2017
Merged

Conversation

hishamhm
Copy link
Contributor

@hishamhm hishamhm commented Oct 6, 2017

When inflate was given a numeric window_size argument,
it was incorrectly falling into lzlib compatibility mode,
because lua_isstring returns true for numbers as well.

Changing to using lua_type checks for the actual data
type (as in Lua type()) and not data convertibility.

Fixes #40.

When inflate was given a numeric `window_size` argument,
it was incorrectly falling into lzlib compatibility mode,
because `lua_isstring` returns true for numbers as well.

Changing to using `lua_type` checks for the actual data
type (as in Lua `type()`) and not data convertibility.
@hishamhm
Copy link
Contributor Author

hishamhm commented Oct 6, 2017

Hi! Thank you for your work on lua-zlib!

Please consider pushing a new release incorporating the latest fixes. I am adding native extraction of zip files to LuaRocks and the inflate() function is not usable in lua-zlib 1.1 neither in lua-zlib (due to the window_size issue fixed by this patch) of lzlib modes (due to the issue fixed by 57b453b).

@brimworks brimworks merged commit dd8e18f into brimworks:master Oct 7, 2017
@brimworks
Copy link
Owner

Thanks @hishamhm ! This was an oversight by me.

@brimworks
Copy link
Owner

The new version has been uploaded here:

https://luarocks.org/modules/brimworks/lua-zlib

1.2-0

@hishamhm
Copy link
Contributor Author

hishamhm commented Oct 8, 2017

@brimworks Yay, thank you for the new release!

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