From 4e54e82dd903b4f7b17bb242e2b9a190b2de3598 Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Sun, 27 Aug 2017 10:25:10 +0200 Subject: Handle lua_pushlstring edge case for Lua 5.2 too. --- c-api/compat-5.3.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'c-api') diff --git a/c-api/compat-5.3.h b/c-api/compat-5.3.h index 7dd77c6..3694df1 100644 --- a/c-api/compat-5.3.h +++ b/c-api/compat-5.3.h @@ -316,6 +316,9 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname, #define lua_getuservalue(L, i) \ (lua_getuservalue(L, i), lua_type(L, -1)) +#define lua_pushlstring(L, s, len) \ + (((len) == 0) ? lua_pushlstring(L, "", 0) : lua_pushlstring(L, (s), (len))) + #define lua_rawgetp(L, i, p) \ (lua_rawgetp(L, i, p), lua_type(L, -1)) -- cgit v1.2.3-55-g6feb