diff options
Diffstat (limited to 'src/pies.c')
-rw-r--r-- | src/pies.c | 48 |
1 files changed, 7 insertions, 41 deletions
@@ -521,43 +521,12 @@ config_array_to_argv (grecs_value_t *val, grecs_locus_t *locus, size_t *pargc) if (pargc) *pargc = argc; return argv; } static int -_cb_command (enum grecs_callback_command cmd, - grecs_locus_t *locus, - void *varptr, grecs_value_t *value, void *cb_data) -{ - struct component *comp = varptr; - struct wordsplit ws; - - switch (value->type) - { - case GRECS_TYPE_STRING: - if (wordsplit (value->v.string, &ws, WRDSF_DEFFLAGS)) - { - grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); - return 1; - } - wordsplit_get_words (&ws, &comp->argc, &comp->argv); - wordsplit_free (&ws); - break; - - case GRECS_TYPE_ARRAY: - comp->argv = config_array_to_argv (value, locus, &comp->argc); - break; - - case GRECS_TYPE_LIST: - grecs_error (locus, 0, _("unexpected list")); - return 1; - } - return 0; -} - -static int _cb_umask (enum grecs_callback_command cmd, grecs_locus_t *locus, void *varptr, grecs_value_t *value, void *cb_data) { mode_t *pmode = varptr; char *p; @@ -586,19 +555,15 @@ _cb_env (enum grecs_callback_command cmd, char ***penv = varptr; struct wordsplit ws; switch (value->type) { case GRECS_TYPE_STRING: - if (wordsplit (value->v.string, &ws, WRDSF_DEFFLAGS)) - { - grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); - return 1; - } - wordsplit_get_words (&ws, &argc, &argv); - wordsplit_free (&ws); + argv = grecs_calloc (2, sizeof (argv[0])); + argv[0] = grecs_strdup (value->v.string); + argv[1] = NULL; break; case GRECS_TYPE_ARRAY: argv = config_array_to_argv (value, locus, NULL); break; @@ -884,12 +849,13 @@ str_to_cf (const char *string, int *flags) { "tcpmuxplus", CF_TCPMUXPLUS }, { "internal", CF_INTERNAL }, { "sockenv", CF_SOCKENV }, { "resolve", CF_RESOLVE }, { "siggroup", CF_SIGGROUP }, { "nullinput", CF_NULLINPUT }, + { "shell", CF_SHELL }, { NULL } }; if (len > 2 && memcmp (string, "no", 2) == 0) { neg++; @@ -1011,15 +977,15 @@ struct grecs_keyword component_keywords[] = { NULL, }, {"command", NULL, N_("Command line."), grecs_type_string, GRECS_DFLT, - NULL, 0, - _cb_command, - }, + NULL, offsetof (struct component, command), + NULL, + }, {"prerequisites", N_("list"), N_("List of prerequisites."), grecs_type_string, GRECS_LIST, NULL, offsetof (struct component, prereq), NULL, }, |