summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-04-26 21:15:25 +0000
committerRoland McGrath <roland@redhat.com>1995-04-26 21:15:25 +0000
commit5d82479d89d0cce0359fa013e705059f6727676f (patch)
tree4174f667d32c8dbbe7268521cb07ee06c9184156
parented0d6072798632e8cbc2beefc4e79e073aab4621 (diff)
downloadgunmake-5d82479d89d0cce0359fa013e705059f6727676f.tar.gz
(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.
-rw-r--r--job.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/job.c b/job.c
index 01b07e9..77bbbae 100644
--- a/job.c
+++ b/job.c
@@ -945,23 +945,17 @@ new_job (file)
c->environment = 0;
/* Fetch the first command line to be run. */
- if (! job_next_command (c))
- {
- /* There were no commands! */
- free_child (c);
- c->file->update_status = 0;
- }
- else
- {
- /* The job is now primed. Start it running. */
- start_waiting_job (c);
-
- if (job_slots == 1)
- /* Since there is only one job slot, make things run linearly.
- Wait for the child to die, setting the state to `cs_finished'. */
- while (file->command_state == cs_running)
- reap_children (1, 0);
- }
+ job_next_command (c);
+
+ /* The job is now primed. Start it running.
+ (This will notice if there are in fact no commands.) */
+ start_waiting_job (c);
+
+ if (job_slots == 1)
+ /* Since there is only one job slot, make things run linearly.
+ Wait for the child to die, setting the state to `cs_finished'. */
+ while (file->command_state == cs_running)
+ reap_children (1, 0);
}
/* Move CHILD's pointers to the next command for it to execute.
@@ -971,7 +965,7 @@ static int
job_next_command (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. */
if (child->command_line == child->file->cmds->ncommand_lines)