summaryrefslogtreecommitdiff
path: root/cd/src/lua5/cdluapdf5.c
diff options
context:
space:
mode:
Diffstat (limited to 'cd/src/lua5/cdluapdf5.c')
-rwxr-xr-xcd/src/lua5/cdluapdf5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cd/src/lua5/cdluapdf5.c b/cd/src/lua5/cdluapdf5.c
index eb3f221..7fd2ece 100755
--- a/cd/src/lua5/cdluapdf5.c
+++ b/cd/src/lua5/cdluapdf5.c
@@ -37,7 +37,11 @@ int cdluapdf_open (lua_State *L)
{
cdluaLuaState* cdL = cdlua_getstate(L);
lua_pushliteral(L, "cd");
+#if LUA_VERSION_NUM > 501
+ lua_pushglobaltable(L);
+#else
lua_gettable(L, LUA_GLOBALSINDEX); /* leave "cd" table at the top of the stack */
+#endif
cdlua_addcontext(L, cdL, &cdluapdfctx);
return 1;
}
@@ -47,7 +51,3 @@ int luaopen_cdluapdf(lua_State* L)
return cdluapdf_open(L);
}
-int luaopen_cdluapdf51(lua_State* L)
-{
- return cdluapdf_open(L);
-}