aboutsummaryrefslogtreecommitdiff
path: root/ltablib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-09-22 03:42:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-09-22 03:42:15 -0300
commit6384475ec4112361b0ab27de553e85863464b846 (patch)
treed2242751ca7ccb13e364a097388708932bdeeb52 /ltablib.c
parent3a15c7ce4338de8414239a898f6c121294b4dde7 (diff)
downloadlua-6384475ec4112361b0ab27de553e85863464b846.tar.gz
lua-6384475ec4112361b0ab27de553e85863464b846.tar.bz2
lua-6384475ec4112361b0ab27de553e85863464b846.zip
'luaL_getmetafield' returns type of metafield (instead of a boolean)
Diffstat (limited to 'ltablib.c')
-rw-r--r--ltablib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ltablib.c b/ltablib.c
index fd868915..8fced7a3 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.74 2014/08/21 19:13:55 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.75 2014/08/21 20:07:56 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -126,10 +126,10 @@ static int tmove (lua_State *L) {
126 luaL_argcheck(L, f > 0, 2, "initial position must be positive"); 126 luaL_argcheck(L, f > 0, 2, "initial position must be positive");
127 if (e >= f) { /* otherwise, nothing to move */ 127 if (e >= f) { /* otherwise, nothing to move */
128 lua_Integer n, i; 128 lua_Integer n, i;
129 ta.geti = (!luaL_getmetafield(L, 1, "__index")) 129 ta.geti = (luaL_getmetafield(L, 1, "__index") == LUA_TNIL)
130 ? (luaL_checktype(L, 1, LUA_TTABLE), lua_rawgeti) 130 ? (luaL_checktype(L, 1, LUA_TTABLE), lua_rawgeti)
131 : lua_geti; 131 : lua_geti;
132 ta.seti = (!luaL_getmetafield(L, tt, "__newindex")) 132 ta.seti = (luaL_getmetafield(L, tt, "__newindex") == LUA_TNIL)
133 ? (luaL_checktype(L, tt, LUA_TTABLE), lua_rawseti) 133 ? (luaL_checktype(L, tt, LUA_TTABLE), lua_rawseti)
134 : lua_seti; 134 : lua_seti;
135 n = e - f + 1; /* number of elements to move */ 135 n = e - f + 1; /* number of elements to move */