Lines 1-25
Link Here
|
1 |
--- src/mod_cml_lua.c.orig 2015-07-26 10:36:36 UTC |
|
|
2 |
+++ src/mod_cml_lua.c |
3 |
@@ -28,6 +28,10 @@ typedef char HASHHEX[HASHHEXLEN+1]; |
4 |
#include <lualib.h> |
5 |
#include <lauxlib.h> |
6 |
|
7 |
+#if LUA_VERSION_NUM >= 502 |
8 |
+#define LUA_GLOBALSINDEX LUA_REGISTRYINDEX |
9 |
+#endif |
10 |
+ |
11 |
typedef struct { |
12 |
stream st; |
13 |
int done; |
14 |
@@ -291,7 +295,11 @@ int cache_parse_lua(server *srv, connect |
15 |
lua_settable(L, LUA_GLOBALSINDEX); |
16 |
|
17 |
/* load lua program */ |
18 |
+#if LUA_VERSION_NUM >= 502 |
19 |
+ if (lua_load(L, load_file, &rm, fn->ptr, NULL) || lua_pcall(L,0,1,0)) { |
20 |
+#else |
21 |
if (lua_load(L, load_file, &rm, fn->ptr) || lua_pcall(L,0,1,0)) { |
22 |
+#endif |
23 |
log_error_write(srv, __FILE__, __LINE__, "s", |
24 |
lua_tostring(L,-1)); |
25 |
|