[net.bugs.4bsd] trivial, but annoying, bug in tail

shp (12/15/82)

[ ]	The tail command does not work properly when copying begins at a
	distance + number from the beginning and number is less than 10.
	If copying lines, and the file has less than 10 lines in it,
	nothing would be printed.

	The reason for this is that the default use of tail is to copy
	from the end of the file, and if no distance is given, the
	distance is set to 10 (otherwise nothing would be printed).

	The fix is:
	================================================================
	diff /usr/src/cmd/tail.c /usr/new/src/cmd/tail/tail.c
	49,50c49,52
	< 	n = 0;
	< 	while(isdigit(*arg))
	---
	> 	n = -1;
	> 	while(isdigit(*arg))	{
	> 		if (n == -1)
	> 			n = 0;
	52,53c54
	< 	if(!fromend&&n>0)
	< 		n--;
	---
	> 	}
	88c89
	< 	if (n==0) n = 10;
	---
	> 	if (n == -1 && fromend) n = 10;



	Sam Praul
	...!decvax!ittvax!shp