[net.micro.amiga] ARC diffs for UNIX BSD

randy@bcsaic.UUCP (randy groves) (09/18/86)

(Chomp!)

Here's some diffs to the recently posted version of Unix ARC.  Done by
Paul Allen at our site.  No guarantee that all the bugs were killed but
we've both used it (I for Amiga, Paul for MSDOS files) and it seems to 
work just fine.  Also included is Paul's Readme (below):


This is the version of arc for BSD from usenet.  I had to hack it a
little to get it to run:

	-	The warn flag was declared but never set to 1.  Thus,
		no warnings ever appeared on the screen.

	-	The note flag was similarly not set, resulting in arc
		by default operating silently.

	-	Many fopen calls were using the "b" option.  This does
		not appear to exist in Ultrix or Sun and isn't really
		necessary on an OS that leaves line endings alone.

	-	The code in the 'test' logic that compared the computed
		crc with the stored crc was broken by the fact that
		sizeof(int) != sizeof(short) on the VAX.

Paul Allen

-----------------------------diffs below-----------------------------------

diff .orig/arc.c ./arc.c
95a96,98
>     warn = 1;				/* make warnings print by default */
>     note = 1;				/* ditto for notes and comments */
> 
diff .orig/arcadd.c ./arcadd.c
208c208,209
<     if(!(f=fopen(path,"rb")))
---
>     /*if(!(f=fopen(path,"rb")))*/
>     if(!(f=fopen(path,"r")))
diff .orig/arccvt.c ./arccvt.c
104c104,105
<     if(!(tmp=fopen(tempname,"wrb")))
---
>     /*if(!(tmp=fopen(tempname,"wrb")))*/
>     if(!(tmp=fopen(tempname,"wr")))
diff .orig/arcext.c ./arcext.c
149c149,150
<     {    if(f=fopen(USE,"rb"))        /* see if it exists */
---
>     /*{    if(f=fopen(USE,"rb")) */       /* see if it exists */
>     {    if(f=fopen(USE,"r"))        /* see if it exists */
167c168,169
<     if(!(f=fopen(USE,"wb")))
---
>     /*if(!(f=fopen(USE,"wb")))*/
>     if(!(f=fopen(USE,"w")))
diff .orig/arcmisc.c ./arcmisc.c
40c40
<   return (&result[0]);
---
>   return (result);
diff .orig/arcrun.c ./arcrun.c
120c120,121
<          if(tmp=fopen(buf,"rb"))
---
>          /*if(tmp=fopen(buf,"rb"))*/
>          if(tmp=fopen(buf,"r"))
122c123,124
<     if(!(tmp=fopen(makefnam("$ARCTEMP",hdr->name,buf),"wrb")))
---
>     /*if(!(tmp=fopen(makefnam("$ARCTEMP",hdr->name,buf),"wrb")))*/
>     if(!(tmp=fopen(makefnam("$ARCTEMP",hdr->name,buf),"wr")))
diff .orig/arcsvc.c ./arcsvc.c
42c42,43
<     if(!(arc=fopen(arcname,"rb")))
---
>     /*if(!(arc=fopen(arcname,"rb")))*/
>     if(!(arc=fopen(arcname,"r")))
49c50,51
<          if(!(new=fopen(newname,"wb")))
---
>          /*if(!(new=fopen(newname,"wb")))*/
>          if(!(new=fopen(newname,"w")))
124c126
<     return ((crc>>8)&0x00ff) ^ crctab[(crc^c)&0x00ff];
---
>     return (((crc>>8)&0x00ff) ^ crctab[(crc^c)&0x00ff]) & 0x0000ffff;
diff .orig/arctst.c ./arctst.c
43a44
> printf ("at start of tstarc, nerrs=%d\n", nerrs);
diff .orig/arcunp.c ./arcunp.c
120c120
<     if(crcval!=hdr->crc)
---
>     if((crcval&0xffff)!=(hdr->crc&0x0000ffff))
-- 
===========================================================================
... only a hollygram, but one more is gone.
===========================================================================
randy groves
...!uw-beaver!uw-june!bcsaic!randy