Bug Fixes to the program CALLS(1)
Kevin S. B. Szabo
ksbszabo at wateng.UUCP
Tue Jun 12 17:59:38 AEST 1984
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)
More information about the Comp.sources.unix
mailing list