From ed5a1e2a7b8211b6cbc6e6801e1f018a13520598 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Mon, 16 Aug 2010 22:48:17 +0200 Subject: Adding raw inflate support, also should hopefully support gz files using zlib_inflate. --- lib/LuaHandle.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/LuaHandle.cc') diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc index 08f4911..ba66afc 100644 --- a/lib/LuaHandle.cc +++ b/lib/LuaHandle.cc @@ -809,15 +809,18 @@ int sLuaHandle::zlib_inflate(lua_State * __L) { int n = L->gettop(); Handle * s, * d; int r; + bool raw = false; - if (n != 2) { + if ((n < 2) || (n > 3) || ((n == 3) && !L->isboolean(3))) { L->error("Incorrect arguments to method `Handle::zlib_inflate'"); } s = L->recast(1); d = L->recast(2); + if (n >= 3) + raw = L->toboolean(3); - r = Handle::zlib_inflate(s, d); + r = Handle::zlib_inflate(s, d, raw); L->push((lua_Number) r); -- cgit v1.2.3