aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSérgio Queiroz <sqmedeiros@gmail.com>2018-02-08 14:56:32 -0300
committerSérgio Queiroz <sqmedeiros@gmail.com>2018-02-08 14:56:32 -0300
commitc540c7828ce2b96b1af8c7c6659003a62b4308a9 (patch)
tree8b14dcba2da2b07b1607defd20ca40734d3aef1a
parente5aae15219b4eb3d6f5eaedd8a6be771ab029399 (diff)
downloadlpeglabel-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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lptree.c b/lptree.c
index bc0333b..33ae79d 100644
--- a/lptree.c
+++ b/lptree.c
@@ -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