[net.sources.bugs] uuen/decode with checksums.

pyle@ut-ngp.UUCP (01/17/87)

> From: flaps@utcsri.UUCP (Alan J Rosenthal)
> Subject: uuen/decode with checksums.
> Date: 13 Jan 87 05:56:06 GMT
> 
> I have made a simple patch which puts a checksum character at the end of each
> line.  Files uuencoded with this new uuencode can be uudecoded with the old
> uudecode without complaint.  If you use this uudecode on a file uuencoded
> with the old uuencode, every line gives a checksum error, so I have made it
> report only the first five checksum errors.  Therefore, if you get errors
> saying that there is a checksum error on lines 1, 2, 3, 4, and 5, you can
> presume that the file you are uudecoding was uuencoded without checksums.

I have made a very simple modification to Alan's uudecode which makes it
more compatible with files encoded with a uuencode lacking his checksum.  The
checksum must be a printable character according to his code, so after reading
the data, the pointer is either pointing to (1) his checksum or (2) at the
newline if an 'old' uuencode was used.  My patch causes the checksum test
to be bypassed if that byte is a newline.  Also, the name of the file being
created is echoed to stdout.

Here's the diff to uudecode.c:

86a87,89
> 	else
> 		printf("%s\n",dest);
> 
129c132
< 		if (checksum != DEC(*bp))
---
> 		if (*bp != '\n' && checksum != DEC(*bp))

Keith Pyle

UUCP: . . .{ihnp4,seismo,ctvax,noao,gatech}!ut-sally!ut-ngp!pyle
ARPA: pyle@ut-ngp