From 1ed329073eb786b2958f723b859c6f99cbe85d98 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Wed, 17 Oct 2012 21:34:38 +0100 Subject: algo.h: fix to make it work on Lua 5.1; oops --- src/algo.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/algo.h b/src/algo.h index 4a0afb3..488cad7 100644 --- a/src/algo.h +++ b/src/algo.h @@ -134,7 +134,11 @@ static void check_subject (lua_State *L, int pos, TArgExec *argE) lua_typename (L, type)); argE->text = lua_touserdata (L, -1); lua_pop (L, 1); +#if LUA_VERSION_NUM == 501 + lua_objlen (L, pos); +#else lua_len (L, pos); +#endif type = lua_type (L, -1); if (type != LUA_TNUMBER) luaL_error (L, "subject's length is %s (expected number)", -- cgit v1.2.1