summaryrefslogtreecommitdiff
path: root/lib/LuaHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r--lib/LuaHandle.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index 5b0d85e..08f4911 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -831,8 +831,9 @@ int sLuaHandle::zlib_deflate(lua_State * __L) {
int r;
int level = Z_DEFAULT_COMPRESSION;
bool raw = false;
+ bool gzip = false;
- if ((n < 2) || (n > 4) || ((n >= 3) && !L->isnumber(3)) || ((n == 4) && !L->isboolean(4))) {
+ if ((n < 2) || (n > 5) || ((n >= 3) && !L->isnumber(3)) || ((n >= 4) && !L->isboolean(4)) || ((n >= 5) && !L->isboolean(5))) {
L->error("Incorrect arguments to method `Handle::zlib_deflate'");
}
@@ -840,10 +841,12 @@ int sLuaHandle::zlib_deflate(lua_State * __L) {
d = L->recast<Handle>(2);
if (n >= 3)
level = L->tonumber(3);
- if (n == 4)
+ if (n >= 4)
raw = L->toboolean(4);
+ if (n >= 5)
+ gzip = L->toboolean(5);
- r = Handle::zlib_deflate(s, d, level, raw);
+ r = Handle::zlib_deflate(s, d, level, raw, gzip);
L->push((lua_Number) r);