Path: ns-mx!hobbes.physics.uiowa.edu!zaphod.mps.ohio-state.edu!qt.cs.utexas.edu!cs.utexas.edu!sun-barr!newstop!sun!amdahl!fadden From: fadden@uts.amdahl.com (Andy McFadden) Newsgroups: comp.binaries.apple2,comp.sys.apple2 Subject: NuLib v3.10 patch (bug in LZW-II) Message-ID: Date: 7 Nov 91 21:51:18 GMT Reply-To: fadden@amdahl.uts.amdahl.com (Andy McFadden) Organization: Amdahl Corporation, Sunnyvale CA Lines: 42 Xref: ns-mx comp.binaries.apple2:2175 comp.sys.apple2:25722 Please apply the following patch to NuLib. The file "nushk.c", which handles all the ShrinkIt LZW compression, has a bug in the LZW-II uncompression (found by Frank Petroski). The current version of NuLib is now v3.12. v3.11 included the patches to make it work correctly on the NeXT, and silenced the warning in nucomp.c. Incidentally, I understand that NuLib now works on a 3B2 without a hitch, so System V users should not have a problem running NuLib v3.1x. (this is a context diff. Save this message into a file, cd to your NuLib source directory, and run "patch < file". If it doesn't work or you don't have "patch", then add the lines that start with a "+".) <---- cut here ----> *** nushk.c Thu Nov 7 13:43:29 1991 --- new.nushk Thu Nov 7 13:44:00 1991 *************** *** 23,32 **** --- 23,36 ---- wrbuf = rbuf; /* write rbuf */ ibuf += unlen; /* have to skip over RLE-only data */ /* normally ibuf is advanced by Getc() calls */ + Table = Real_tab-256; /* must clear table if no LZW */ + entry = 0x101; /* start at $101 */ } else { wrbuf = ibuf; /* write ibuf */ ibuf += partial; /* skip over uncompressed data */ /* normally ibuf is advanced by Getc() calls */ + Table = Real_tab-256; /* must clear table if no LZW */ + entry = 0x101; /* start at $101 */ } if (type2) <---- cut here ----> You may also want to change line 12 in numain.c to read: "NuLib v3.12 November 1991 Freeware Copyright 1989-91 By Andy McFadden"; -- fadden@uts.amdahl.com (Andy McFadden) fadden@cory.berkeley.edu (expires in December) [ Above opinions are mine, Amdahl has nothing to do with them, etc, etc. ]