[comp.sys.amiga.tech] Find program Bug

belanger@philmtl.philips.ca (Robert Belanger) (04/13/89)

	I don't know if anybody tried to re-compile the find program that
	was posted on the net a little while ago. I could compile it but
	When I ran it it gave me not output :-(, so I looked in the code
	and found out that if the we are using a AND combination as in

	    >find "" -name #?.c -print

	That is "find all the files that match #?.c and print them".
	This would not work because the compile tree is not built properly
	The tree is built using a register local variable in the procedure
	compile for node_head, and it initializes it to NULL always. In the
	compile routine, if the node_head (the wrong one is used here,because
	there is a global one and a local one (==NULL)) is NULL then the
	node_head is assigned the operation rather than a AND operation.

	So instead of building:

		AND
	    /	    \
	-name #?.c   -print
	
	It builds:


		-name #?.c


	only. So the tree is never scanned down for obvious reason.
	So how does the original work or am I the only one with this problem.

	On a side note if you define a global and a local with the same name
	you should access the local before right?

	Robert Belanger

============================================================================
Philips Electronics Ltd.	Harfang des Neiges:	  Robert L. Belanger
600 Frederick Philips BlvD.   Embleme aviaire du  Advanced Development Group
St-Laurent, Quebec, CANADA	    Quebec			ECHO project
H4M 2S9	(514)-744-8200-2495		  	     Eternity is very long!!
E-MAIL belanger@philmtl.philips.ca		    Especially in the end!!!
============================================================================