diff options
author | Sérgio Queiroz <sqmedeiros@gmail.com> | 2018-02-08 14:56:32 -0300 |
---|---|---|
committer | Sérgio Queiroz <sqmedeiros@gmail.com> | 2018-02-08 14:56:32 -0300 |
commit | c540c7828ce2b96b1af8c7c6659003a62b4308a9 (patch) | |
tree | 8b14dcba2da2b07b1607defd20ca40734d3aef1a | |
parent | e5aae15219b4eb3d6f5eaedd8a6be771ab029399 (diff) | |
download | lpeglabel-c540c7828ce2b96b1af8c7c6659003a62b4308a9.tar.gz lpeglabel-c540c7828ce2b96b1af8c7c6659003a62b4308a9.tar.bz2 lpeglabel-c540c7828ce2b96b1af8c7c6659003a62b4308a9.zip |
Using lua_tointerger instead of lua_tointegerx to keep compatibility with Lua 5.1
-rw-r--r-- | lptree.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1205,13 +1205,12 @@ static int lp_match (lua_State *L) { | |||
1205 | if (r == NULL) { /* labeled failure begin */ | 1205 | if (r == NULL) { /* labeled failure begin */ |
1206 | lua_pushnil(L); | 1206 | lua_pushnil(L); |
1207 | if (labelf) { | 1207 | if (labelf) { |
1208 | int isnum; | 1208 | lua_Integer luaInt; |
1209 | lua_Integer lInt; | ||
1210 | lua_rawgeti(L, ktableidx(ptop), labelf); | 1209 | lua_rawgeti(L, ktableidx(ptop), labelf); |
1211 | lInt = lua_tointegerx(L, -1, &isnum); | 1210 | luaInt = lua_tointeger(L, -1); |
1212 | if (isnum) { | 1211 | if (luaInt) { |
1213 | lua_pop(L, 1); | 1212 | lua_pop(L, 1); |
1214 | lua_pushinteger(L, lInt); | 1213 | lua_pushinteger(L, luaInt); |
1215 | } | 1214 | } |
1216 | } | 1215 | } |
1217 | else | 1216 | else |