summaryrefslogtreecommitdiff
path: root/src/lua5/cdluapdf5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua5/cdluapdf5.c')
-rw-r--r--src/lua5/cdluapdf5.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lua5/cdluapdf5.c b/src/lua5/cdluapdf5.c
index 40877ad..7fd2ece 100644
--- a/src/lua5/cdluapdf5.c
+++ b/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;
}