Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!apple!well!jef From: jef@well.UUCP (Jef Poskanzer) Newsgroups: comp.sources.bugs Subject: patch 1 for PBMPLUS of 22nov89: pgmtops -rle Message-ID: <14746@well.UUCP> Date: 28 Nov 89 17:29:04 GMT Reply-To: Jef Poskanzer Organization: Paratheo-Anametamystikhood Of Eris Esoteric, Ada Lovelace Cabal Lines: 55 Juha Sarlin noticed that pgmtops -rle doesn't work at all in this release, which seems like a pretty serious bug. He also provided the simple fix appended below. I think this is my first patch ever. I hope it doesn't get to be a habit. --- Jef Jef Poskanzer jef@well.sf.ca.us {ucbvax, apple, hplabs}!well!jef "Let's do it." -- Gary Gilmore *** pgmtops.c.orig Mon Nov 27 17:54:25 1989 --- pgmtops.c Mon Nov 27 22:46:56 1989 *************** *** 385,391 **** rleitem = 0; rlebitsperitem = 0; ! rlebitshift = 8 - bitsperitem; } rleputgray( g ) --- 385,391 ---- rleitem = 0; rlebitsperitem = 0; ! rlebitshift = 8 - bitspersample; } rleputgray( g ) *************** *** 392,403 **** gray g; { if ( rlebitsperitem == 8 ) - { rleputitem( ); - } rleitem += g << rlebitshift; ! rlebitsperitem += bitsperitem; ! rlebitshift -= bitsperitem; } rleputrest( ) --- 392,401 ---- gray g; { if ( rlebitsperitem == 8 ) rleputitem( ); rleitem += g << rlebitshift; ! rlebitsperitem += bitspersample; ! rlebitshift -= bitspersample; } rleputrest( )