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

Support newer version than Lua5.1 #1

Open
data-man opened this issue Oct 15, 2019 · 1 comment
Open

Support newer version than Lua5.1 #1

data-man opened this issue Oct 15, 2019 · 1 comment

Comments

@data-man
Copy link

Thanks for the fork!
What version of Lua is used?

My patch for Lua > 5.1

--- a/src/luahooks.c
+++ b/src/luahooks.c
@@ -145,7 +145,7 @@ luahooks_init ()
if (opt.lua_filename == NULL)
return;

-  lua = lua_open ();
+  lua = luaL_newstate ();;
luaL_openlibs (lua);

/* Initialize constants. */
@@ -489,7 +489,7 @@ luahooks_lookup_host (const char *host)
return NULL;

/* Copy to the buffer. */
-      size_t ret_l = lua_strlen(lua, -1);
+      size_t ret_l = lua_rawlen(lua, -1);
ret_l = (ret_l <= MAX_HOST_LENGTH) ? ret_l : MAX_HOST_LENGTH;
strncpy (lookup_host_result, ret, ret_l);
@Fusl
Copy link
Member

Fusl commented Feb 19, 2020

Lua 5.1 is the only officially supported Lua version for this project. Anything else may work through patches but isn't guaranteed to function in exactly the same way. I may be able to look into porting this to 5.2-5.4 at one point but not right at this moment. If you do have a patch that makes wget-lua work for 5.1 up to 5.4, feel free to open a pull request and I'll happily look into merging it.

@Arkiver2 Arkiver2 added the enhancement New feature or request label May 6, 2022
@Arkiver2 Arkiver2 removed the enhancement New feature or request label Jun 17, 2023
@Arkiver2 Arkiver2 changed the title Compiling error Support newer version than Lua5.1 Jun 17, 2023
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

3 participants