summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2012-10-17 21:34:38 +0100
committerReuben Thomas <rrt@sc3d.org>2012-10-17 21:34:38 +0100
commit1ed329073eb786b2958f723b859c6f99cbe85d98 (patch)
treed522691d8eaab30a6c4096199134fec2cc8010be
parenta23eb8906b15a517d1a5261ce1ccd829a0ce131c (diff)
downloadlrexlib-1ed329073eb786b2958f723b859c6f99cbe85d98.tar.gz
algo.h: fix to make it work on Lua 5.1; oops
-rw-r--r--src/algo.h4
1 files changed, 4 insertions, 0 deletions
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)",