Skip to content

Commit

Permalink
Using lua_tointerger instead of lua_tointegerx to keep compatibility …
Browse files Browse the repository at this point in the history
…with Lua 5.1
  • Loading branch information
sqmedeiros committed Feb 8, 2018
1 parent e5aae15 commit c540c78
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lptree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1205,13 +1205,12 @@ static int lp_match (lua_State *L) {
if (r == NULL) { /* labeled failure begin */
lua_pushnil(L);
if (labelf) {
int isnum;
lua_Integer lInt;
lua_Integer luaInt;
lua_rawgeti(L, ktableidx(ptop), labelf);
lInt = lua_tointegerx(L, -1, &isnum);
if (isnum) {
luaInt = lua_tointeger(L, -1);
if (luaInt) {
lua_pop(L, 1);
lua_pushinteger(L, lInt);
lua_pushinteger(L, luaInt);
}
}
else
Expand Down

0 comments on commit c540c78

Please sign in to comment.