[net.sources.bugs] ARC squeeze fix

ben@catnip.UUCP (Bennett Broder) (12/26/86)

In article <390@monuxa.UUCP> john@monuxa.UUCP (John Ruschmeyer) writes:
>When the UNIX  version of ARC was posted a while ago, I brought it up on
>our systems here. Unlike a recent poster to this newsgroup, I had no
>problem with the Lempel-Ziv (crunch) code, but never could get it to
>correctly squeeze or unsqueeze a file in an archive.
>
>   ...    Using code from that program I was able to fix the problem with
>ARC not correctly unsqueezing a file in the archive (creating either a
>zero-length file or giving the 'invalid decode tree' message).
>
>NOTE: I am still having problems with the squeeze code on our system. For
>some reason, trying to archive a file which would normally be squeezed on
>the MS-DOS version of ARC results in it being compressed with some
>less-efficient method. I think this is a bug, but it appears to be a
>harmless one.

In order to decide which compression routine to use, ARC estimates the
size of the resulting file.  The squeezing routine was handicapped
considerably, since the routine calculating the squeezed file size was
figuring on using 16 bytes to store each integer.

Here are the diffs to remedy this problem.

*** arcsq.c	Fri Dec 26 14:00:28 1986
--- arcsq.c.old	Fri Dec 26 13:59:48 1986
***************
*** 18,24
  */
  #include <stdio.h>
  
! #define int16size 2			/* 2 bytes */
  
  /* stuff for Huffman squeezing */
  

--- 18,24 -----
  */
  #include <stdio.h>
  
! #define int16size 16			/* 16 bits */
  
  /* stuff for Huffman squeezing */
  
-- 

Ben Broder
{ihnp4,decvax} !hjuxa!catnip!ben
{houxm,clyde}/