From ed3bdf38d721d1f20aef9017b32e14acc0e56192 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 7 Aug 2008 16:20:11 +0000 Subject: zlib: add inflateReset2()... metze (This used to be commit 2a4fb661d7e3d601a5eb9ccecb4d4f2b07073097) --- source4/lib/zlib/inflate.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source4/lib/zlib/inflate.c') diff --git a/source4/lib/zlib/inflate.c b/source4/lib/zlib/inflate.c index 792fdee8e9..0c1ff17951 100644 --- a/source4/lib/zlib/inflate.c +++ b/source4/lib/zlib/inflate.c @@ -100,8 +100,9 @@ local int updatewindow OF((z_streamp strm, unsigned out)); local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, unsigned len)); -int ZEXPORT inflateReset(strm) +int ZEXPORT inflateReset2(strm, flags) z_streamp strm; +unsigned flags; { struct inflate_state FAR *state; @@ -115,8 +116,10 @@ z_streamp strm; state->havedict = 0; state->dmax = 32768U; state->head = Z_NULL; - state->wsize = 0; - state->whave = 0; + if (!(flags & Z_RESET_KEEP_WINDOW)) { + state->wsize = 0; + state->whave = 0; + } state->write = 0; state->hold = 0; state->bits = 0; @@ -125,6 +128,12 @@ z_streamp strm; return Z_OK; } +int ZEXPORT inflateReset(strm) +z_streamp strm; +{ + return inflateReset2(strm, 0); +} + int ZEXPORT inflatePrime(strm, bits, value) z_streamp strm; int bits; -- cgit