summaryrefslogtreecommitdiff
path: root/lib/LuaHandle.cc
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-08-16 22:48:17 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-08-16 22:48:17 +0200
commited5a1e2a7b8211b6cbc6e6801e1f018a13520598 (patch)
tree1a516acb3bae80e31e7a8e7408eada06c6b2123a /lib/LuaHandle.cc
parentb011a334614861a603f7837c536c51c69b0a4258 (diff)
Adding raw inflate support, also should hopefully support gz files using zlib_inflate.
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r--lib/LuaHandle.cc7
1 files changed, 5 insertions, 2 deletions
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<Handle>(1);
d = L->recast<Handle>(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);