Skip to content

Support newer version than Lua5.1 #1

Description

@data-man

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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