diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2015-01-19 19:12:24 +0100 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2015-01-19 19:12:24 +0100 |
commit | f7f85b0826f7006b8dcc040111cd0ef8d42c2352 (patch) | |
tree | 504dc073a89e2b5483aabb0778db6c438d15ed6d /c-api | |
parent | 6a55913a7f53d16e65f23a7c4e5ac7c2edfbf47a (diff) | |
download | lua-compat-5.3-f7f85b0826f7006b8dcc040111cd0ef8d42c2352.tar.gz lua-compat-5.3-f7f85b0826f7006b8dcc040111cd0ef8d42c2352.tar.bz2 lua-compat-5.3-f7f85b0826f7006b8dcc040111cd0ef8d42c2352.zip |
prepare to use ltablib.c from 5.3 for table library
Diffstat (limited to 'c-api')
-rw-r--r-- | c-api/compat-5.3.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/c-api/compat-5.3.c b/c-api/compat-5.3.c index ecb22b0..e45c728 100644 --- a/c-api/compat-5.3.c +++ b/c-api/compat-5.3.c | |||
@@ -36,7 +36,8 @@ COMPAT53_API void lua_len (lua_State *L, int i) { | |||
36 | switch (lua_type(L, i)) { | 36 | switch (lua_type(L, i)) { |
37 | case LUA_TSTRING: /* fall through */ | 37 | case LUA_TSTRING: /* fall through */ |
38 | case LUA_TTABLE: | 38 | case LUA_TTABLE: |
39 | lua_pushnumber(L, (int)lua_objlen(L, i)); | 39 | if (!luaL_callmeta(L, i, "__len")) |
40 | lua_pushnumber(L, (int)lua_objlen(L, i)); | ||
40 | break; | 41 | break; |
41 | case LUA_TUSERDATA: | 42 | case LUA_TUSERDATA: |
42 | if (luaL_callmeta(L, i, "__len")) | 43 | if (luaL_callmeta(L, i, "__len")) |