Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/zlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zlib.c')
-rw-r--r--zlib.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/zlib.c b/zlib.c
index be9d7e963b..b613cbd750 100644
--- a/zlib.c
+++ b/zlib.c
@@ -32,6 +32,21 @@ void git_inflate_init(z_streamp strm)
strm->msg ? strm->msg : "no message");
}
+void git_inflate_init_gzip_only(z_streamp strm)
+{
+ /*
+ * Use default 15 bits, +16 is to accept only gzip and to
+ * yield Z_DATA_ERROR when fed zlib format.
+ */
+ const int windowBits = 15 + 16;
+ int status = inflateInit2(strm, windowBits);
+
+ if (status == Z_OK)
+ return;
+ die("inflateInit2: %s (%s)", zerr_to_string(status),
+ strm->msg ? strm->msg : "no message");
+}
+
void git_inflate_end(z_streamp strm)
{
int status = inflateEnd(strm);