aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c44
1 files changed, 17 insertions, 27 deletions
diff --git a/src/comp.c b/src/comp.c
index 7056855..6eeeeed 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -597,6 +597,5 @@ component_verify (struct component *comp, grecs_locus_t *locus)
}
- else if (!comp->argv)
- COMPERR (grecs_error,
- "%s", _("missing command line"));
-
+ else if (!comp->command)
+ COMPERR (grecs_error, "%s", _("no 'command' statement"));
+
if (ISCF_TCPMUX (comp->flags))
@@ -738,5 +737,4 @@ component_finish (struct component *comp, grecs_locus_t *locus)
{
- if (!comp->command)
+ if (component_verify (comp, locus))
{
- grecs_error (locus, 0, "%s", _("no 'command' statement"));
component_free (comp);
@@ -754,3 +752,3 @@ component_finish (struct component *comp, grecs_locus_t *locus)
}
- else
+ else if (comp->command)
{
@@ -775,25 +773,17 @@ component_finish (struct component *comp, grecs_locus_t *locus)
- if (component_verify (comp, locus))
+ if (grecs_list_size (comp->prereq) == 1)
{
- component_free (comp);
- }
- else
- {
- size_t n = grecs_list_size (comp->prereq);
- if (n == 1)
+ const char *item = grecs_list_index (comp->prereq, 0);
+ if (strcmp (item, "all") == 0)
{
- const char *item = grecs_list_index (comp->prereq, 0);
- if (strcmp (item, "all") == 0)
- {
- struct component *p;
+ struct component *p;
- grecs_list_clear (comp->prereq);
- for (p = comp->prev; p; p = p->prev)
- grecs_list_push (comp->prereq, grecs_strdup (comp->tag));
- }
- else if (strcmp (item, "none") == 0)
- {
- grecs_list_free (comp->prereq);
- comp->prereq = NULL;
- }
+ grecs_list_clear (comp->prereq);
+ for (p = comp->prev; p; p = p->prev)
+ grecs_list_push (comp->prereq, grecs_strdup (comp->tag));
+ }
+ else if (strcmp (item, "none") == 0)
+ {
+ grecs_list_free (comp->prereq);
+ comp->prereq = NULL;
}

Return to:

Send suggestions and report system problems to the System administrator.