From: utzoo!decvax!duke!harpo!ihnp4!ixn5c!inuxc!pur-ee!iuvax!isrnix!greg
Newsgroups: net.unix-wizards
Title: Small bug in dirtree
Article-I.D.: isrnix.183
Posted: Tue Jan 18 01:11:00 1983
Received: Sun Jan 23 07:13:25 1983

  There are two small bugs in the dirtree program submitted by Greg Ordy.
One is due to the fact that the program assumes that the directory
entrys "." and ".." are always entrys 1 and 2 of the directory. On our
system at least thats not only the case. The fix is:

	Delete the line that says:

	fseek(fp, (long) (2 * (sizeof(de))), 0);	/Pass up . and .. */

	In the routine build_tree, and change the line that says:

	if(de.d_ino == 0)

		-to-

	if((de.d_ino == 0) || (strcmp(de.d_name,"..") == 0) || (strcmp(de.d_name,".") == 0))

	In the same routine (build_tree).

	The other bug has to do with clipping. To fix it add the line:

	clipped++;

	After the fprintf in routine display() that says:

	fprintf(stderr,"Truncated structure. Col....


Greg Travis
pur-ee!isrnix!greg