diff options
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")) |
