=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/job.c,v retrieving revision 1.59 retrieving revision 1.60 diff -c -r1.59 -r1.60 *** src/usr.bin/make/job.c 2005/04/13 02:33:08 1.59 --- src/usr.bin/make/job.c 2007/01/04 17:55:35 1.60 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.59 2005/04/13 02:33:08 deraadt Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: job.c,v 1.60 2007/01/04 17:55:35 espie Exp $ */ /* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */ /* *************** *** 434,440 **** static void HandleSigs(void); static void JobPassSig(int); static int JobCmpPid(void *, void *); ! static int JobPrintCommand(void *, void *); static void JobSaveCommand(void *, void *); static void JobClose(Job *); static void JobFinish(Job *, int *); --- 434,440 ---- static void HandleSigs(void); static void JobPassSig(int); static int JobCmpPid(void *, void *); ! static int JobPrintCommand(LstNode, void *); static void JobSaveCommand(void *, void *); static void JobClose(Job *); static void JobFinish(Job *, int *); *************** *** 672,678 **** *----------------------------------------------------------------------- */ static int ! JobPrintCommand(void *cmdp, /* command string to print */ void *jobp) /* job for which to print it */ { bool noSpecials; /* true if we shouldn't worry about --- 672,678 ---- *----------------------------------------------------------------------- */ static int ! JobPrintCommand(LstNode cmdNode, /* command string to print */ void *jobp) /* job for which to print it */ { bool noSpecials; /* true if we shouldn't worry about *************** *** 686,693 **** char *cmdTemplate; /* Template to use when printing the * command */ char *cmdStart; /* Start of expanded command */ ! LstNode cmdNode; /* Node for replacing the command */ ! char *cmd = (char *)cmdp; Job *job = (Job *)jobp; noSpecials = (noExecute && !(job->node->type & OP_MAKE)); --- 686,692 ---- char *cmdTemplate; /* Template to use when printing the * command */ char *cmdStart; /* Start of expanded command */ ! char *cmd = (char *)Lst_Datum(cmdNode); Job *job = (Job *)jobp; noSpecials = (noExecute && !(job->node->type & OP_MAKE)); *************** *** 695,701 **** if (strcmp(cmd, "...") == 0) { job->node->type |= OP_SAVE_CMDS; if ((job->flags & JOB_IGNDOTS) == 0) { ! job->tailCmds = Lst_Succ(Lst_Member(&job->node->commands, cmd)); return 0; } return 1; --- 694,700 ---- if (strcmp(cmd, "...") == 0) { job->node->type |= OP_SAVE_CMDS; if ((job->flags & JOB_IGNDOTS) == 0) { ! job->tailCmds = Lst_Succ(cmdNode); return 0; } return 1; *************** *** 712,718 **** /* For debugging, we replace each command with the result of expanding * the variables in the command. */ - cmdNode = Lst_Member(&job->node->commands, cmd); cmdStart = cmd = Var_Subst(cmd, &job->node->context, false); Lst_Replace(cmdNode, cmdStart); --- 711,716 ---- *************** *** 1664,1670 **** gn->current = Lst_Succ(gn->current); if (gn->current == NULL || ! !JobPrintCommand(Lst_Datum(gn->current), job)) { noExec = true; gn->current = NULL; } --- 1662,1668 ---- gn->current = Lst_Succ(gn->current); if (gn->current == NULL || ! !JobPrintCommand(gn->current, job)) { noExec = true; gn->current = NULL; } *************** *** 1687,1693 **** * We can do all the commands at once. hooray for sanity */ numCommands = 0; ! Lst_Find(&gn->commands, JobPrintCommand, job); /* * If we didn't print out any commands to the shell script, --- 1685,1691 ---- * We can do all the commands at once. hooray for sanity */ numCommands = 0; ! Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, job); /* * If we didn't print out any commands to the shell script, *************** *** 1713,1719 **** * doesn't do any harm in this case and may do some good. */ if (cmdsOK) { ! Lst_Find(&gn->commands, JobPrintCommand, job); } /* * Don't execute the shell, thank you. --- 1711,1717 ---- * doesn't do any harm in this case and may do some good. */ if (cmdsOK) { ! Lst_ForEachNodeWhile(&gn->commands, JobPrintCommand, job); } /* * Don't execute the shell, thank you.