diff options
author | Shmuel Zeigerman <solomuz0@gmail.com> | 2014-08-06 01:57:30 +0300 |
---|---|---|
committer | Shmuel Zeigerman <solomuz0@gmail.com> | 2014-08-06 01:57:30 +0300 |
commit | d55af4735715605f99fd112574e776ddf1f1a312 (patch) | |
tree | 41c9875e3ca7230f810489b61850aa904074b7fa | |
parent | 0087f459bac1ce6290ed6bf8f77d7150bb87899a (diff) | |
download | lrexlib-d55af4735715605f99fd112574e776ddf1f1a312.tar.gz |
Make error message with Lua 5.1 the same as with 5.2.
-rw-r--r-- | src/algo.h | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -137,10 +137,8 @@ static void check_subject (lua_State *L, int pos, TArgExec *argE) #if LUA_VERSION_NUM == 501 if (!luaL_callmeta (L, pos, "__len")) luaL_argerror (L, pos, "the subject has no valid __len metamethod"); - type = lua_type (L, -1); - if (type != LUA_TNUMBER) - luaL_error (L, "subject's length is %s (expected number)", - lua_typename (L, type)); + if (lua_type (L, -1) != LUA_TNUMBER) + luaL_argerror (L, pos, "object length is not a number"); argE->textlen = lua_tointeger (L, -1); lua_pop (L, 1); #else |