diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -329,11 +329,11 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { | |||
| 329 | */ | 329 | */ |
| 330 | 330 | ||
| 331 | 331 | ||
| 332 | LUA_API void lua_getglobal (lua_State *L, const char *name) { | 332 | LUA_API void lua_getstr (lua_State *L, int index, const char *name) { |
| 333 | TObject o; | 333 | TObject o; |
| 334 | lua_lock(L); | 334 | lua_lock(L); |
| 335 | setsvalue(&o, luaS_new(L, name)); | 335 | setsvalue(&o, luaS_new(L, name)); |
| 336 | luaV_gettable(L, gt(L), &o, L->top); | 336 | luaV_gettable(L, luaA_index(L, index), &o, L->top); |
| 337 | api_incr_top(L); | 337 | api_incr_top(L); |
| 338 | lua_unlock(L); | 338 | lua_unlock(L); |
| 339 | } | 339 | } |
| @@ -406,12 +406,12 @@ LUA_API void lua_geteventtable (lua_State *L, int objindex) { | |||
| 406 | */ | 406 | */ |
| 407 | 407 | ||
| 408 | 408 | ||
| 409 | LUA_API void lua_setglobal (lua_State *L, const char *name) { | 409 | LUA_API void lua_setstr (lua_State *L, int index, const char *name) { |
| 410 | TObject o; | 410 | TObject o; |
| 411 | lua_lock(L); | 411 | lua_lock(L); |
| 412 | api_checknelems(L, 1); | 412 | api_checknelems(L, 1); |
| 413 | setsvalue(&o, luaS_new(L, name)); | 413 | setsvalue(&o, luaS_new(L, name)); |
| 414 | luaV_settable(L, gt(L), &o, L->top - 1); | 414 | luaV_settable(L, luaA_index(L, index), &o, L->top - 1); |
| 415 | L->top--; /* remove element from the top */ | 415 | L->top--; /* remove element from the top */ |
| 416 | lua_unlock(L); | 416 | lua_unlock(L); |
| 417 | } | 417 | } |
