[gnu.utils.bug] tar 1.07 bugfix for compressed archives

juha@tds.kth.se (Juha Sarlin) (07/28/89)

GNU Tar 1.07 tries to zero the unused part of the last block when -z (compress)
option is used, but misses slightly; some other part of the block gets zeroed
instead.

Also, it seems to be an undocumented "feature" that a single -z doesn't pad
the last block to blocksize, but two does.

Repeat by something like:
	tar -cvzz -f /dev/rst8 -b 200 *

And here is my fix:

*** /tmp/,RCSt1a00327	Thu Jul 27 20:29:49 1989
--- buffer.c	Thu Jul 27 20:35:25 1989
***************
*** 419,425 ****
  						if(f_compress<2)
  							blocksize-=n;
  						else
! 							bzero(ar_block->charptr+n,blocksize-n);
  						err=rmtwrite(archive,ar_block->charptr,blocksize);
  						if(err!=(blocksize))
  							writeerror(err);
--- 419,425 ----
  						if(f_compress<2)
  							blocksize-=n;
  						else
! 							bzero(ar_block->charptr+blocksize-n,n);
  						err=rmtwrite(archive,ar_block->charptr,blocksize);
  						if(err!=(blocksize))
  							writeerror(err);
--
Juha Sarlin	juha@tds.kth.se