Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site wateng.UUCP
Path: utzoo!watmath!wateng!ksbszabo
From: ksbszabo@wateng.UUCP (Kevin S. B. Szabo)
Newsgroups: net.sources
Subject: Bug Fixes to the program CALLS(1)
Message-ID: <1083@wateng.UUCP>
Date: Tue, 12-Jun-84 03:59:38 EDT
Article-I.D.: wateng.1083
Posted: Tue Jun 12 03:59:38 1984
Date-Received: Tue, 12-Jun-84 04:27:29 EDT
Organization: U of Waterloo, Ontario
Lines: 30

A few months ago the program CALLS was distributed on the network.
I have used it to determine the calling sequence of a number of packages
and found it quite useful. I have also found two bugs which 
manifested themselves in the routine scan(), below. The first
is that CALLS() didn't consider the underscore character a valid
part of an identifier. The second was that the scanning
routine didn't flush the end of a 'too long' identifier
and thus managed to see the end of an identifier upon subsequent calls to
scan(). The corrected routine is shown below. 


scan (atom)
char atom[];
{
	char c;
	int i;

	c = lastchar;
	i = 0;
	while( isalpha(c) || isdigit(c) || (c == '_') ){
		atom [i++] = (c=getch());
		if (i == ATOMLENGTH ) break;
		}
	atom [i-1] = '\0';
	while( isalpha(c) || isdigit(c) || (c == '_') ) c = getch();
	lastchar= c;
	return (1);
}
-- 
	Kevin Szabo  watmath!wateng!ksbszabo (Elec Eng, U of Waterloo)