summaryrefslogtreecommitdiff
path: root/iup/srclua5/iuplua_cd.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:26:30 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:32:26 +0200
commit7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch)
treeb6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/srclua5/iuplua_cd.c
parente9a184546b18cf3b796bd560561f312934004c54 (diff)
Upgrading to IUP 3.2 - and cleaning up.
Diffstat (limited to 'iup/srclua5/iuplua_cd.c')
-rwxr-xr-xiup/srclua5/iuplua_cd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/iup/srclua5/iuplua_cd.c b/iup/srclua5/iuplua_cd.c
index c14932a..184ef84 100755
--- a/iup/srclua5/iuplua_cd.c
+++ b/iup/srclua5/iuplua_cd.c
@@ -39,8 +39,13 @@ static cdluaContext cdluaiupctx =
int cdluaiup_open (lua_State *L)
{
cdluaLuaState* cdL = cdlua_getstate(L);
+ /* leave "cd" table at the top of the stack */
lua_pushstring(L, "cd");
- lua_gettable(L, LUA_GLOBALSINDEX); /* leave "cd" table at the top of the stack */
+#if LUA_VERSION_NUM > 501
+ lua_pushglobaltable(L);
+#else
+ lua_gettable(L, LUA_GLOBALSINDEX);
+#endif
cdlua_addcontext(L, cdL, &cdluaiupctx);
return 1;
}
@@ -50,7 +55,3 @@ int luaopen_iupluacd(lua_State* L)
return cdluaiup_open(L);
}
-int luaopen_iupluacd51(lua_State* L)
-{
- return cdluaiup_open(L);
-}