summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1998-10-13 20:59:08 +0000
committerPaul Smith <psmith@gnu.org>1998-10-13 20:59:08 +0000
commit394864015453ce78c822e6457df04fe483f4bfb0 (patch)
tree22f24043d01395fa9197c32c7ab5e2ed4c521e4f /job.c
parent2c64fb221a265f9e7fc93374906b1e7540377561 (diff)
downloadgunmake-394864015453ce78c822e6457df04fe483f4bfb0.tar.gz
Ignore non-empty lines which become empty after variable expansion.
Don't choke on invalid pattern rules if we fail during makefile parsing. Don't dump core if a non-empty command becomes empty after expansion.
Diffstat (limited to 'job.c')
-rw-r--r--job.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/job.c b/job.c
index fcdd2f1..7a77481 100644
--- a/job.c
+++ b/job.c
@@ -1274,11 +1274,16 @@ new_job (file)
c->sh_batch_file = NULL;
/* Fetch the first command line to be run. */
- job_next_command (c);
-
- /* The job is now primed. Start it running.
- (This will notice if there are in fact no commands.) */
- (void)start_waiting_job (c);
+ if (job_next_command (c))
+ /* The job is now primed. Start it running. */
+ (void)start_waiting_job (c);
+ else
+ {
+ /* There were no commands (variable expands to empty?). All done. */
+ c->file->update_status = 0;
+ notice_finished_file(c->file);
+ free_child (c);
+ }
if (job_slots == 1)
/* Since there is only one job slot, make things run linearly.