[BusyBox] My cleaned up bunzip.

Glenn McGrath bug1 at optushome.com.au
Wed Oct 15 04:47:16 UTC 2003

On Tue, 14 Oct 2003 20:57:37 -0500
Rob Landley <rob at landley.net> wrote:

> Here's the code.  This is more or less ready to go in.  I'm going to stop 
> looking at it for a while.  All you should have to do is chop off the main() 
> at the end and call it from bunzip2, and life should otherwise be good. :)

There is a problem integrating it with tar, the existing tar code used
read_bz2(...) to read a specified number of bytes.

Your new bunzip tries to decompresses without stoping, which is the way
bb gunzip used to work. To get around this with tar -z we used to fork,
decompress in another process, and pipe the decompressed data back to
the parent, allowing tar to specify how many bytes it read from the

Laurence Anderson added read_gz which simplified things from tar's

So we can either use the old fork/decompress/pipe method or add a
read_bz2 function, each method has its advantages/disadvantages,
ideally we should use the same method for both gunzip and bunzip2.


More information about the busybox mailing list