summaryrefslogtreecommitdiff
path: root/zlib/uncompr.c
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2004-07-21 17:36:26 -0700
committerkonstantin@mysql.com <>2004-07-21 17:36:26 -0700
commitd2c1f3fc379d11ec236cb786726be4ba647b3b6f (patch)
treee1c502ab20782af7b4564054ae3c46a321ccbb4e /zlib/uncompr.c
parent58bdb6221ce902ed5a17c7130f2352c3e33f085c (diff)
downloadmariadb-git-d2c1f3fc379d11ec236cb786726be4ba647b3b6f.tar.gz
First step of implementation of WL#1518 "make bundled zlib
usable for unix builds": zlib 1.2.1 imported
Diffstat (limited to 'zlib/uncompr.c')
-rw-r--r--zlib/uncompr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/zlib/uncompr.c b/zlib/uncompr.c
index a287714f5de..b59e3d0defb 100644
--- a/zlib/uncompr.c
+++ b/zlib/uncompr.c
@@ -1,10 +1,11 @@
/* uncompr.c -- decompress a memory buffer
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
+ * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
+#define ZLIB_INTERNAL
#include "zlib.h"
/* ===========================================================================
@@ -49,7 +50,9 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
err = inflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
inflateEnd(&stream);
- return err == Z_OK ? Z_BUF_ERROR : err;
+ if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
+ return Z_DATA_ERROR;
+ return err;
}
*destLen = stream.total_out;