Hello community,
here is the log from the commit of package rzip
checked in at Fri Aug 11 15:53:54 CEST 2006.
--------
--- rzip/rzip.changes 2006-01-25 21:41:17.000000000 +0100
+++ rzip/rzip.changes 2006-08-11 11:05:40.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Aug 11 11:04:13 CEST 2006 - schwab@suse.de
+
+- Update to rzip 2.1.
+ * No release notes.
+
+-------------------------------------------------------------------
Old:
----
rzip-2.0.tar.gz
New:
----
rzip-2.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rzip.spec ++++++
--- /var/tmp/diff_new_pack.5zGNiP/_old 2006-08-11 15:52:40.000000000 +0200
+++ /var/tmp/diff_new_pack.5zGNiP/_new 2006-08-11 15:52:40.000000000 +0200
@@ -1,18 +1,18 @@
#
-# spec file for package rzip (Version 2.0)
+# spec file for package rzip (Version 2.1)
#
-# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
-# Please submit bugfixes or comments via http://www.suse.de/feedback/
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: rzip
Summary: A large-file compression program
-Version: 2.0
+Version: 2.1
Release: 1
Group: Productivity/Archiving/Compression
License: GPL
@@ -51,6 +51,9 @@
%{_mandir}/man*/*
%changelog -n rzip
+* Fri Aug 11 2006 - schwab@suse.de
+- Update to rzip 2.1.
+ * No release notes.
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Nov 02 2005 - schwab@suse.de
++++++ rzip-2.0.tar.gz -> rzip-2.1.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/Makefile.in new/rzip-2.1/Makefile.in
--- old/rzip-2.0/Makefile.in 2003-10-06 13:53:00.000000000 +0200
+++ new/rzip-2.1/Makefile.in 2006-02-14 01:38:23.000000000 +0100
@@ -42,5 +42,11 @@
rzip.1: rzip.yo
yodl2man -o rzip.1 rzip.yo
+web/rzip-man.html: rzip.yo
+ mkdir -p man
+ yodl2html -o web/rzip-man.html rzip.yo
+
+docs: rzip.1 web/rzip-man.html
+
clean:
rm -f *~ $(OBJS) rzip config.cache config.log config.status
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/find_stream_match.c new/rzip-2.1/find_stream_match.c
--- old/rzip-2.0/find_stream_match.c 1970-01-01 01:00:00.000000000 +0100
+++ new/rzip-2.1/find_stream_match.c 2004-03-12 01:01:06.000000000 +0100
@@ -0,0 +1,353 @@
+/* Example piece of code to demonstrate how to find a match in a
+ stream, without buffering, for use in rzip on *really* huge files.
+
+ Copyright (C) 2003 Rusty Russell, IBM Corporation
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "md4.h"
+
+struct hash_entry {
+ uint64_t offset;
+ uchar bitness;
+ uchar md4[MD4_DIGEST_SIZE];
+};
+
+typedef uint32_t tag;
+
+#define HASH_BITS 10
+#define MINIMUM_BITNESS 1
+#define MAXIMUM_BITNESS 32 /* need to increase tag size to increase this */
+#define WINDOW_LENGTH 31
+
+/* Simple optimization for read() */
+#define BUFFER_SIZE 4096
+
+static struct hash_entry hash[1 << HASH_BITS];
+static const unsigned int hash_limit = (1 << HASH_BITS) * 2 / 3;
+static unsigned int hash_min_bitness = MINIMUM_BITNESS;
+static unsigned int hash_count;
+static unsigned int hash_clean_ptr;
+static tag hash_index[256];
+static int verbosity = 2;
+
+static void barf_perror(const char *fmt, ...)
+{
+ char *str = strerror(errno);
+ va_list arglist;
+
+ fprintf(stderr, "FATAL: ");
+
+ va_start(arglist, fmt);
+ vfprintf(stderr, fmt, arglist);
+ va_end(arglist);
+
+ fprintf(stderr, ": %s\n", str);
+ exit(1);
+}
+
+static int bitness(tag t)
+{
+ return ffs(t) ?: 32;
+}
+
+static int empty_hash(unsigned int h)
+{
+ return !hash[h].bitness;
+}
+
+static uint32_t primary_hash(const struct hash_entry *h)
+{
+ return h->md4[1] & ((1 << HASH_BITS) - 1);
+}
+
+static inline int hash_equals(const struct hash_entry *a,
+ const struct hash_entry *b)
+{
+ return memcmp(a->md4, b->md4, sizeof(a->md4)) == 0;
+}
+
+/* Eliminate one hash entry of minimum bitness. */
+static void clean_one_from_hash(void)
+{
+again:
+ if (verbosity > 1) {
+ if (!hash_clean_ptr)
+ printf("Starting sweep for mask %u\n",
+ hash_min_bitness);
+ }
+
+ for (; hash_clean_ptr < (1<bitness) {
+ struct hash_entry old = hash[h];
+ hash[h] = *new;
+ insert_hash(&old);
+ return NULL;
+ }
+
+ h++;
+ h &= ((1 << HASH_BITS) - 1);
+ }
+
+ hash[h] = *new;
+ if (++hash_count > hash_limit)
+ clean_one_from_hash();
+ return NULL;
+}
+
+static inline tag next_tag(uchar old, uchar new, tag t)
+{
+ t ^= hash_index[old];
+ t ^= hash_index[new];
+ return t;
+}
+
+static inline tag full_tag(uchar *p, unsigned int len)
+{
+ tag ret = 0;
+ int i;
+ for (i=0;i 0) {
+ assert(doff >= WINDOW_LENGTH);
+ /* Make sure we always have some buffer. */
+ if (dlen == 1) {
+ /* Keep WINDOW_LENGTH behind at all times. */
+ unsigned int newstart, keep;
+
+ newstart = doff - WINDOW_LENGTH;
+ keep = WINDOW_LENGTH + dlen;
+ if (laststrong < newstart) {
+ strong_sums(data+laststrong, md4,
+ newstart-laststrong);
+ laststrong = 0;
+ } else
+ laststrong -= newstart;
+
+ memmove(data, data+newstart, keep);
+ doff = WINDOW_LENGTH;
+ r = read(fd_in, data+keep, BUFFER_SIZE-keep);
+ if (r < 0)
+ barf_perror("read of input failed: %s");
+ dlen += r;
+ }
+ t = next_tag(data[doff-WINDOW_LENGTH], data[doff], t);
+
+ if (bitness(t) > hash_min_bitness) {
+ /* Update strong sums. */
+ strong_sums(data+laststrong, md4, doff-laststrong);
+ if (debug)
+ printf("Adding: %lu - %lu %.*s\n",
+ laststrong, doff,
+ doff-laststrong,
+ data+laststrong);
+
+ laststrong = doff;
+
+ /* End each block of sufficient bitness. */
+ lastlen = 0;
+ for (i = bitness(t); i >= hash_min_bitness; i--) {
+ struct hash_entry he, *old;
+
+ md4_final(&md4[i], (unsigned char *)he.md4);
+ he.bitness = i;
+ he.offset = start[i];
+
+ /* Don't put in the same hash twice. */
+ if (off - start[i] != lastlen) {
+ if (verbosity > 1)
+ printf("%i: Putting %lu@%lu"
+ " in hash\n",
+ i, off - start[i],
+ start[i]);
+ old = insert_hash(&he);
+ lastlen = off - start[i];
+ if (old) {
+ found_match(fd_in,
+ lastlen,
+ start[i],
+ old->offset);
+ }
+ }
+
+ /* Start new strong hash, from *start* of
+ window (ie. overlaps last one). */
+ md4_init(&md4[i]);
+ md4_update(&md4[i],
+ data + doff - WINDOW_LENGTH,
+ WINDOW_LENGTH);
+ start[i] = off - WINDOW_LENGTH;
+ if (start[i] == 28039)
+ debug = true;
+
+ if (debug)
+ printf("Starting %lu: %.*s\n",
+ start[i],
+ WINDOW_LENGTH,
+ data + doff - WINDOW_LENGTH);
+ }
+ }
+ doff++;
+ dlen--;
+ off++;
+ }
+ return off;
+}
+
+static void init_hash_indexes(void)
+{
+ int i;
+ for (i=0;i<256;i++) {
+ hash_index[i] = ((random()<<16) ^ random());
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ unsigned int i;
+
+ init_hash_indexes();
+
+ for (i = 1; i < argc; i++) {
+ off_t len;
+ int fd = open(argv[i], O_RDONLY);
+ if (fd < 0)
+ barf_perror("Opening %s", argv[i]);
+
+ len = stream_search(fd);
+ close(fd);
+ printf("Length of %s: %llu\n", argv[i], (long long)len);
+
+ }
+ return 0;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/main.c new/rzip-2.1/main.c
--- old/rzip-2.0/main.c 2004-02-12 01:01:08.000000000 +0100
+++ new/rzip-2.1/main.c 2006-02-14 01:38:23.000000000 +0100
@@ -34,6 +34,7 @@
printf(" -f force overwrite of any existing files\n");
printf(" -k keep existing files\n");
printf(" -P show compression progress\n");
+ printf(" -L level set compression level\n");
printf(" -V show version\n");
#if 0
/* damn, this will be quite hard to do */
@@ -138,9 +139,8 @@
fatal("%s: unknown suffix\n", control->infile);
}
- control->outfile = strndup(control->infile,
- strlen(control->infile) -
- strlen(control->suffix));
+ control->outfile = strdup(control->infile);
+ control->outfile[strlen(control->infile) - strlen(control->suffix)] = 0;
}
fd_in = open(control->infile,O_RDONLY);
@@ -209,7 +209,13 @@
if (control->outname) {
control->outfile = strdup(control->outname);
} else {
- asprintf(&control->outfile, "%s%s", control->infile, control->suffix);
+ control->outfile = malloc(strlen(control->infile) +
+ strlen(control->suffix) + 1);
+ if (!control->outfile) {
+ fatal("Failed to allocate outfile name\n");
+ }
+ strcpy(control->outfile, control->infile);
+ strcat(control->outfile, control->suffix);
}
fd_in = open(control->infile,O_RDONLY);
@@ -261,12 +267,15 @@
control.flags |= FLAG_DECOMPRESS;
}
- while ((c = getopt(argc, argv, "h0123456789dS:tVvkfPo:")) != -1) {
+ while ((c = getopt(argc, argv, "h0123456789dS:tVvkfPo:L:")) != -1) {
if (isdigit(c)) {
control.compression_level = c - '0';
continue;
}
switch (c) {
+ case 'L':
+ control.compression_level = atoi(optarg);
+ break;
case 'd':
control.flags |= FLAG_DECOMPRESS;
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/md4.c new/rzip-2.1/md4.c
--- old/rzip-2.0/md4.c 1970-01-01 01:00:00.000000000 +0100
+++ new/rzip-2.1/md4.c 2004-03-12 01:01:06.000000000 +0100
@@ -0,0 +1,204 @@
+/*
+ * Cryptographic API (taken from the Linux Kernel)
+ *
+ * MD4 Message Digest Algorithm (RFC1320).
+ *
+ * Implementation derived from Andrew Tridgell and Steve French's
+ * CIFS MD4 implementation, and the cryptoapi implementation
+ * originally based on the public domain implementation written
+ * by Colin Plumb in 1993.
+ *
+ * Copyright (c) Andrew Tridgell 1997-1998.
+ * Modified by Steve French (sfrench@us.ibm.com) 2002
+ * Copyright (c) Cryptoapi developers.
+ * Copyright (c) 2002 David S. Miller (davem@redhat.com)
+ * Copyright (c) 2002 James Morris
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+#include "rzip.h"
+#include "md4.h"
+#include
+
+#define u32 uint32
+
+static inline u32 lshift(u32 x, unsigned int s)
+{
+ x &= 0xFFFFFFFF;
+ return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s));
+}
+
+static inline u32 F(u32 x, u32 y, u32 z)
+{
+ return (x & y) | ((~x) & z);
+}
+
+static inline u32 G(u32 x, u32 y, u32 z)
+{
+ return (x & y) | (x & z) | (y & z);
+}
+
+static inline u32 H(u32 x, u32 y, u32 z)
+{
+ return x ^ y ^ z;
+}
+
+#define ROUND1(a,b,c,d,k,s) (a = lshift(a + F(b,c,d) + k, s))
+#define ROUND2(a,b,c,d,k,s) (a = lshift(a + G(b,c,d) + k + (u32)0x5A827999,s))
+#define ROUND3(a,b,c,d,k,s) (a = lshift(a + H(b,c,d) + k + (u32)0x6ED9EBA1,s))
+
+/* XXX: this stuff can be optimized */
+static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
+{
+ while (words--) {
+ *buf = ntohl(*buf);
+ buf++;
+ }
+}
+
+static inline void cpu_to_le32_array(u32 *buf, unsigned int words)
+{
+ while (words--) {
+ *buf = htonl(*buf);
+ buf++;
+ }
+}
+
+static void md4_transform(u32 *hash, u32 const *in)
+{
+ u32 a, b, c, d;
+
+ a = hash[0];
+ b = hash[1];
+ c = hash[2];
+ d = hash[3];
+
+ ROUND1(a, b, c, d, in[0], 3);
+ ROUND1(d, a, b, c, in[1], 7);
+ ROUND1(c, d, a, b, in[2], 11);
+ ROUND1(b, c, d, a, in[3], 19);
+ ROUND1(a, b, c, d, in[4], 3);
+ ROUND1(d, a, b, c, in[5], 7);
+ ROUND1(c, d, a, b, in[6], 11);
+ ROUND1(b, c, d, a, in[7], 19);
+ ROUND1(a, b, c, d, in[8], 3);
+ ROUND1(d, a, b, c, in[9], 7);
+ ROUND1(c, d, a, b, in[10], 11);
+ ROUND1(b, c, d, a, in[11], 19);
+ ROUND1(a, b, c, d, in[12], 3);
+ ROUND1(d, a, b, c, in[13], 7);
+ ROUND1(c, d, a, b, in[14], 11);
+ ROUND1(b, c, d, a, in[15], 19);
+
+ ROUND2(a, b, c, d,in[ 0], 3);
+ ROUND2(d, a, b, c, in[4], 5);
+ ROUND2(c, d, a, b, in[8], 9);
+ ROUND2(b, c, d, a, in[12], 13);
+ ROUND2(a, b, c, d, in[1], 3);
+ ROUND2(d, a, b, c, in[5], 5);
+ ROUND2(c, d, a, b, in[9], 9);
+ ROUND2(b, c, d, a, in[13], 13);
+ ROUND2(a, b, c, d, in[2], 3);
+ ROUND2(d, a, b, c, in[6], 5);
+ ROUND2(c, d, a, b, in[10], 9);
+ ROUND2(b, c, d, a, in[14], 13);
+ ROUND2(a, b, c, d, in[3], 3);
+ ROUND2(d, a, b, c, in[7], 5);
+ ROUND2(c, d, a, b, in[11], 9);
+ ROUND2(b, c, d, a, in[15], 13);
+
+ ROUND3(a, b, c, d,in[ 0], 3);
+ ROUND3(d, a, b, c, in[8], 9);
+ ROUND3(c, d, a, b, in[4], 11);
+ ROUND3(b, c, d, a, in[12], 15);
+ ROUND3(a, b, c, d, in[2], 3);
+ ROUND3(d, a, b, c, in[10], 9);
+ ROUND3(c, d, a, b, in[6], 11);
+ ROUND3(b, c, d, a, in[14], 15);
+ ROUND3(a, b, c, d, in[1], 3);
+ ROUND3(d, a, b, c, in[9], 9);
+ ROUND3(c, d, a, b, in[5], 11);
+ ROUND3(b, c, d, a, in[13], 15);
+ ROUND3(a, b, c, d, in[3], 3);
+ ROUND3(d, a, b, c, in[11], 9);
+ ROUND3(c, d, a, b, in[7], 11);
+ ROUND3(b, c, d, a, in[15], 15);
+
+ hash[0] += a;
+ hash[1] += b;
+ hash[2] += c;
+ hash[3] += d;
+}
+
+static inline void md4_transform_helper(struct md4_ctx *ctx)
+{
+ le32_to_cpu_array(ctx->block, sizeof(ctx->block) / sizeof(u32));
+ md4_transform(ctx->hash, ctx->block);
+}
+
+void md4_init(struct md4_ctx *mctx)
+{
+ mctx->hash[0] = 0x67452301;
+ mctx->hash[1] = 0xefcdab89;
+ mctx->hash[2] = 0x98badcfe;
+ mctx->hash[3] = 0x10325476;
+ mctx->byte_count = 0;
+}
+
+void md4_update(struct md4_ctx *mctx, const uchar *data, unsigned int len)
+{
+ const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f);
+
+ mctx->byte_count += len;
+
+ if (avail > len) {
+ memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
+ data, len);
+ return;
+ }
+
+ memcpy((char *)mctx->block + (sizeof(mctx->block) - avail),
+ data, avail);
+
+ md4_transform_helper(mctx);
+ data += avail;
+ len -= avail;
+
+ while (len >= sizeof(mctx->block)) {
+ memcpy(mctx->block, data, sizeof(mctx->block));
+ md4_transform_helper(mctx);
+ data += sizeof(mctx->block);
+ len -= sizeof(mctx->block);
+ }
+
+ memcpy(mctx->block, data, len);
+}
+
+void md4_final(struct md4_ctx *mctx, uchar *out)
+{
+ const unsigned int offset = mctx->byte_count & 0x3f;
+ char *p = (char *)mctx->block + offset;
+ int padding = 56 - (offset + 1);
+
+ *p++ = 0x80;
+ if (padding < 0) {
+ memset(p, 0x00, padding + sizeof (uint64));
+ md4_transform_helper(mctx);
+ p = (char *)mctx->block;
+ padding = 56;
+ }
+
+ memset(p, 0, padding);
+ mctx->block[14] = mctx->byte_count << 3;
+ mctx->block[15] = mctx->byte_count >> 29;
+ le32_to_cpu_array(mctx->block, (sizeof(mctx->block) -
+ sizeof(uint64)) / sizeof(u32));
+ md4_transform(mctx->hash, mctx->block);
+ cpu_to_le32_array(mctx->hash, sizeof(mctx->hash) / sizeof(u32));
+ memcpy(out, mctx->hash, sizeof(mctx->hash));
+ memset(mctx, 0, sizeof(*mctx));
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/md4.h new/rzip-2.1/md4.h
--- old/rzip-2.0/md4.h 1970-01-01 01:00:00.000000000 +0100
+++ new/rzip-2.1/md4.h 2004-03-12 01:01:06.000000000 +0100
@@ -0,0 +1,23 @@
+#ifndef _RZIP_MD4_H
+#define _RZIP_MD4_H
+#include
+
+#define MD4_DIGEST_SIZE 16
+#define MD4_HMAC_BLOCK_SIZE 64
+#define MD4_BLOCK_WORDS 16
+#define MD4_HASH_WORDS 4
+
+typedef unsigned char uchar;
+
+struct md4_ctx {
+ uint32_t hash[MD4_HASH_WORDS];
+ uint32_t block[MD4_BLOCK_WORDS];
+ uint64_t byte_count;
+};
+void md4_init(struct md4_ctx *mctx);
+
+void md4_update(struct md4_ctx *mctx, const uchar *data, unsigned int len);
+
+void md4_final(struct md4_ctx *mctx, uchar *out);
+
+#endif /* _RZIP_MD4_H */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/rzip.1 new/rzip-2.1/rzip.1
--- old/rzip-2.0/rzip.1 2003-10-06 14:56:01.000000000 +0200
+++ new/rzip-2.1/rzip.1 2006-02-14 01:38:23.000000000 +0100
@@ -18,7 +18,8 @@
-0 fastest (worst) compression
- -9 slowest (best) compression (default)
+ -6 default compression
+ -9 slowest (best) compression
-d decompress
-o filename specify the output file name
-S suffix specify compressed suffix (default \&'\&.rz\&')
@@ -41,11 +42,10 @@
.IP
.IP "\fB-0\&.\&.9\fP"
Set the compression level from 0 to 9\&. The default is
-to use level 9, which is the slowest but gives the best compression
-rate\&. The compression level is also strongly related to how much
+to use level 6, which is a reasonable compromise between speed and
+compression\&. The compression level is also strongly related to how much
memory rzip uses, so if you are running rzip on a machine with limited
-amounts of memory then you will probably want to choose a level less
-than 9\&.
+amounts of memory then you will probably want to choose a smaller level\&.
.IP
.IP "\fB-d\fP"
Decompress\&. If this option is not used then rzip looks at
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/rzip.c new/rzip-2.1/rzip.c
--- old/rzip-2.0/rzip.c 2003-11-30 11:09:05.000000000 +0100
+++ new/rzip-2.1/rzip.c 2006-02-14 01:38:23.000000000 +0100
@@ -561,7 +561,7 @@
fatal("Failed to allocate control state in rzip_fd\n");
}
- st->level = &levels[control->compression_level];
+ st->level = &levels[MIN(9, control->compression_level)];
st->control = control;
st->fd_in = fd_in;
st->fd_out = fd_out;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/rzip.h new/rzip-2.1/rzip.h
--- old/rzip-2.0/rzip.h 2003-10-08 00:08:28.000000000 +0200
+++ new/rzip-2.1/rzip.h 2006-02-14 01:38:23.000000000 +0100
@@ -17,7 +17,7 @@
*/
#define RZIP_MAJOR_VERSION 2
-#define RZIP_MINOR_VERSION 0
+#define RZIP_MINOR_VERSION 1
#define NUM_STREAMS 2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/stream.c new/rzip-2.1/stream.c
--- old/rzip-2.0/stream.c 2003-10-08 00:08:28.000000000 +0200
+++ new/rzip-2.1/stream.c 2006-02-14 01:38:23.000000000 +0100
@@ -60,7 +60,7 @@
c_buf = malloc(dlen);
if (!c_buf) return;
- if (BZ2_bzBuffToBuffCompress(c_buf, &dlen, s->buf, s->buflen,
+ if (BZ2_bzBuffToBuffCompress((char*)c_buf, &dlen, (char*)s->buf, s->buflen,
s->bzip_level, 0, s->bzip_level*10) !=
BZ_OK) {
free(c_buf);
@@ -91,7 +91,7 @@
return -1;
}
- bzerr = BZ2_bzBuffToBuffDecompress(s->buf, &dlen, c_buf, c_len, 0, 0);
+ bzerr = BZ2_bzBuffToBuffDecompress((char*)s->buf, &dlen, (char*)c_buf, c_len, 0, 0);
if (bzerr != BZ_OK) {
err_msg("Failed to decompress buffer - bzerr=%d\n", bzerr);
return -1;
@@ -281,6 +281,8 @@
for (i=0;is[i].last_head==0 &&
+ i == 0) {
+ err_msg("Enabling stream close workaround\n");
+ sinfo->initial_pos += 13;
+ goto again;
+ }
+
sinfo->total_read += 13;
if (c != CTYPE_NONE) {
@@ -468,7 +477,8 @@
struct stream_info *sinfo = ss;
int i;
for (i=0;i<sinfo->num_streams;i++) {
- if (flush_buffer(sinfo, i) != 0) {
+ if (sinfo->s[i].buflen != 0 &&
+ flush_buffer(sinfo, i) != 0) {
return -1;
}
if (sinfo->s[i].buf) free(sinfo->s[i].buf);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/rzip-2.0/util.c new/rzip-2.1/util.c
--- old/rzip-2.0/util.c 2003-10-05 03:55:21.000000000 +0200
+++ new/rzip-2.1/util.c 2006-02-14 01:38:23.000000000 +0100
@@ -50,6 +50,6 @@
}
- printf("Fatal error - exiting\n");
+ fprintf(stderr, "Fatal error - exiting\n");
exit(1);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...