From: Linus Torvalds Date: Wed, 6 Jul 2005 00:06:09 +0000 (-0700) Subject: Don't special-case a zero-sized compression. X-Git-Tag: v0.99~64 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=291ec0f2d2ce65e5ccb876b46d6468af49ddb82e;p=git.git Don't special-case a zero-sized compression. zlib actually writes a header for that case, and while ignoring that header will get us the right data, it will also end up messing up our stream position. So we actually want zlib to "uncompress" even an empty object. --- diff --git a/unpack-objects.c b/unpack-objects.c index 97d26818..6383db94 100644 --- a/unpack-objects.c +++ b/unpack-objects.c @@ -55,8 +55,6 @@ static void *get_data(unsigned long size) z_stream stream; void *buf = xmalloc(size); - if (!size) - return buf; memset(&stream, 0, sizeof(stream)); stream.next_out = buf;