ln = Lst_Member(pgn->children, (ClientData)cgn);
ln = Lst_Member(pgn->children, cgn);
SuffExpandChildren(cgnp, pgnp)    ClientData  cgnp;	    /* Child to examine */    ClientData  pgnp;	    /* Parent node being processed */{    GNode   	*cgn = (GNode *) cgnp;    GNode   	*pgn = (GNode *) pgnp;    GNode	*gn;	    /* New source 8) */    LstNode   	prevLN;    /* Node after which new source should be put */    LstNode	ln; 	    /* List element for old source */    char	*cp;	    /* Expanded value */    /*     * New nodes effectively take the place of the child, so place them     * after the child     */    prevLN = Lst_Member(pgn->children, (ClientData)cgn);    /*     * First do variable expansion -- this takes precedence over     * wildcard expansion. If the result contains wildcards, they'll be gotten     * to later since the resulting words are tacked on to the end of     * the children list.     */    if (strchr(cgn->name, '$') != (char *)NULL) {	if (DEBUG(SUFF)) {	    printf("Expanding \"%s\"...", cgn->name);	}	cp = Var_Subst(cgn->name, pgn, TRUE);	if (cp != (char *)NULL) {	    Lst	    members = Lst_Init();	    if (cgn->type & OP_ARCHV) {		/*		 * Node was an archive(member) target, so we want to call		 * on the Arch module to find the nodes for us, expanding		 * variables in the parent's context.		 */		char	*sacrifice = cp;		(void)Arch_ParseArchive(&sacrifice, members, pgn);	    } else {		/*		 * Break the result into a vector of strings whose nodes		 * we can find, then add those nodes to the members list.		 * Unfortunately, we can't use brk_string b/c it		 * doesn't understand about variable specifications with		 * spaces in them...		 */		char	    *start;		char	    *initcp = cp;   /* For freeing... */		for (start = cp; *start == ' ' || *start == '\t'; start++)		    continue;		for (cp = start; *cp != '\0'; cp++) {		    if (*cp == ' ' || *cp == '\t') {			/*			 * White-space -- terminate element, find the node,			 * add it, skip any further spaces.			 */			*cp++ = '\0';			gn = Targ_FindNode(start, TARG_CREATE);			Lst_AtEnd(members, (ClientData)gn);			while (*cp == ' ' || *cp == '\t') {			    cp++;			}			/*			 * Adjust cp for increment at start of loop, but			 * set start to first non-space.			 */			start = cp--;		    } else if (*cp == '$') {			/*			 * Start of a variable spec -- contact variable module			 * to find the end so we can skip over it.			 */			char	*junk;			size_t 	len;			Boolean	doFree;			junk = Var_Parse(cp, pgn, TRUE, &len, &doFree);			if (junk != var_Error) {			    cp += len - 1;			}			if (doFree) {			    free(junk);			}		    } else if (*cp == '\\' && *cp != '\0') {			/*			 * Escaped something -- skip over it			 */			cp++;		    }		}		if (cp != start) {		    /*		     * Stuff left over -- add it to the list too		     */		    gn = Targ_FindNode(start, TARG_CREATE);		    Lst_AtEnd(members, (ClientData)gn);		}		/*		 * Point cp back at the beginning again so the variable value		 * can be freed.		 */		cp = initcp;	    }	    /*	     * Add all elements of the members list to the parent node.	     */	    while((gn = (GNode *)Lst_DeQueue(members)) != NULL) {		if (DEBUG(SUFF)) {		    printf("%s...", gn->name);		}		if (Lst_Member(pgn->children, (ClientData)gn) == NULL) {		    Lst_Append(pgn->children, prevLN, (ClientData)gn);		    prevLN = Lst_Succ(prevLN);		    Lst_AtEnd(gn->parents, (ClientData)pgn);		    pgn->unmade++;		}	    }	    Lst_Destroy(members, NOFREE);	    /*	     * Free the result	     */	    free((char *)cp);	}	/*	 * Now the source is expanded, remove it from the list of children to	 * keep it from being processed.	 */	ln = Lst_Member(pgn->children, (ClientData)cgn);	pgn->unmade--;	Lst_Remove(pgn->children, ln);	if (DEBUG(SUFF)) {	    printf("\n");	}    } else if (Dir_HasWildcards(cgn->name)) {	Lst 	exp;	    /* List of expansions */	Lst 	path;	    /* Search path along which to expand */	/*	 * Find a path along which to expand the word.	 *	 * If the word has a known suffix, use that path.	 * If it has no known suffix and we're allowed to use the null	 *   suffix, use its path.	 * Else use the default system search path.	 */	cp = cgn->name + strlen(cgn->name);	ln = Lst_Find(sufflist, SuffSuffIsSuffixP, (ClientData)cp);	if (DEBUG(SUFF)) {	    printf("Wildcard expanding \"%s\"...", cgn->name);	}	if (ln != NULL) {	    Suff    *s = (Suff *)Lst_Datum(ln);	    if (DEBUG(SUFF)) {		printf("suffix is \"%s\"...", s->name);	    }	    path = s->searchPath;	} else {	    /*	     * Use default search path	     */	    path = dirSearchPath;	}	/*	 * Expand the word along the chosen path	 */	exp = Lst_Init();	Dir_Expand(cgn->name, path, exp);	/* Fetch next expansion off the list and find its GNode.  */	while ((cp = (char *)Lst_DeQueue(exp)) != NULL) {	    if (DEBUG(SUFF)) {		printf("%s...", cp);	    }	    gn = Targ_FindNode(cp, TARG_CREATE);	    /*	     * If gn isn't already a child of the parent, make it so and	     * up the parent's count of unmade children.	     */	    if (Lst_Member(pgn->children, (ClientData)gn) == NULL) {		Lst_Append(pgn->children, prevLN, (ClientData)gn);		prevLN = Lst_Succ(prevLN);		Lst_AtEnd(gn->parents, (ClientData)pgn);		pgn->unmade++;	    }	}	/*	 * Nuke what's left of the list	 */	Lst_Destroy(exp, NOFREE);	/*	 * Now the source is expanded, remove it from the list of children to	 * keep it from being processed.	 */	ln = Lst_Member(pgn->children, (ClientData)cgn);	pgn->unmade--;	Lst_Remove(pgn->children, ln);	if (DEBUG(SUFF)) {	    printf("\n");	}    }    return(0);}