mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-02-07 06:47:52 +00:00
(job_next_command): Skip empty lines.
(new_job): Don't test the return of job_next_command. Just let start_waiting_job handle the case of empty commands.
This commit is contained in:
parent
ed0d607279
commit
5d82479d89
1 changed files with 11 additions and 17 deletions
16
job.c
16
job.c
|
@ -945,15 +945,10 @@ new_job (file)
|
||||||
c->environment = 0;
|
c->environment = 0;
|
||||||
|
|
||||||
/* Fetch the first command line to be run. */
|
/* Fetch the first command line to be run. */
|
||||||
if (! job_next_command (c))
|
job_next_command (c);
|
||||||
{
|
|
||||||
/* There were no commands! */
|
/* The job is now primed. Start it running.
|
||||||
free_child (c);
|
(This will notice if there are in fact no commands.) */
|
||||||
c->file->update_status = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* The job is now primed. Start it running. */
|
|
||||||
start_waiting_job (c);
|
start_waiting_job (c);
|
||||||
|
|
||||||
if (job_slots == 1)
|
if (job_slots == 1)
|
||||||
|
@ -961,7 +956,6 @@ new_job (file)
|
||||||
Wait for the child to die, setting the state to `cs_finished'. */
|
Wait for the child to die, setting the state to `cs_finished'. */
|
||||||
while (file->command_state == cs_running)
|
while (file->command_state == cs_running)
|
||||||
reap_children (1, 0);
|
reap_children (1, 0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Move CHILD's pointers to the next command for it to execute.
|
/* Move CHILD's pointers to the next command for it to execute.
|
||||||
|
@ -971,7 +965,7 @@ static int
|
||||||
job_next_command (child)
|
job_next_command (child)
|
||||||
struct child *child;
|
struct child *child;
|
||||||
{
|
{
|
||||||
if (child->command_ptr == 0 || *child->command_ptr == '\0')
|
while (child->command_ptr == 0 || *child->command_ptr == '\0')
|
||||||
{
|
{
|
||||||
/* There are no more lines in the expansion of this line. */
|
/* There are no more lines in the expansion of this line. */
|
||||||
if (child->command_line == child->file->cmds->ncommand_lines)
|
if (child->command_line == child->file->cmds->ncommand_lines)
|
||||||
|
|
Loading…
Reference in a new issue