aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/comp.c b/src/comp.c
index 7056855..6eeeeed 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -595,9 +595,8 @@ component_verify (struct component *comp, grecs_locus_t *locus)
"%s", _("\"internal\" used with \"command\""));
}
}
- 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))
{
@@ -736,9 +735,8 @@ component_verify (struct component *comp, grecs_locus_t *locus)
void
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);
return;
}
@@ -752,7 +750,7 @@ component_finish (struct component *comp, grecs_locus_t *locus)
comp->argv[2] = grecs_strdup (comp->command);
comp->argv[3] = NULL;
}
- else
+ else if (comp->command)
{
struct wordsplit ws;
if (wordsplit (comp->command, &ws, WRDSF_DEFFLAGS))
@@ -773,14 +771,7 @@ component_finish (struct component *comp, grecs_locus_t *locus)
if (comp->privs.groups)
comp->privs.groups->cmp = list_str_cmp;
- if (component_verify (comp, locus))
- {
- component_free (comp);
- }
- else
- {
- size_t n = grecs_list_size (comp->prereq);
- if (n == 1)
+ if (grecs_list_size (comp->prereq) == 1)
{
const char *item = grecs_list_index (comp->prereq, 0);
if (strcmp (item, "all") == 0)
@@ -798,7 +789,6 @@ component_finish (struct component *comp, grecs_locus_t *locus)
}
}
}
-}
struct component *
component_get (size_t n)

Return to:

Send suggestions and report system problems to the System administrator.