Skip to content

Commit a1e7eb6

Browse files
committed
Fix. On Lua 5.3 returns info as integer.
1 parent 6426798 commit a1e7eb6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lceasy.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,13 @@ static int lcurl_info_get_long_(lua_State *L, int opt){
790790
return lcurl_fail_ex(L, p->err_mode, LCURL_ERROR_EASY, code);
791791
}
792792

793-
lua_pushnumber(L, val);
793+
#if LUA_VERSION_NUM >= 503 /* Lua 5.3 */
794+
if(sizeof(lua_Integer) >= sizeof(val))
795+
lua_pushinteger(L, (lua_Integer)val);
796+
else
797+
#endif
798+
lua_pushnumber(L, val);
799+
794800
return 1;
795801
}
796802

0 commit comments

Comments
 (0)