diff options
Diffstat (limited to 'src/pies.c')
-rw-r--r-- | src/pies.c | 48 |
1 files changed, 7 insertions, 41 deletions
@@ -524,37 +524,6 @@ config_array_to_argv (grecs_value_t *val, grecs_locus_t *locus, size_t *pargc) | |||
524 | } | 524 | } |
525 | 525 | ||
526 | static int | 526 | static int |
527 | _cb_command (enum grecs_callback_command cmd, | ||
528 | grecs_locus_t *locus, | ||
529 | void *varptr, grecs_value_t *value, void *cb_data) | ||
530 | { | ||
531 | struct component *comp = varptr; | ||
532 | struct wordsplit ws; | ||
533 | |||
534 | switch (value->type) | ||
535 | { | ||
536 | case GRECS_TYPE_STRING: | ||
537 | if (wordsplit (value->v.string, &ws, WRDSF_DEFFLAGS)) | ||
538 | { | ||
539 | grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); | ||
540 | return 1; | ||
541 | } | ||
542 | wordsplit_get_words (&ws, &comp->argc, &comp->argv); | ||
543 | wordsplit_free (&ws); | ||
544 | break; | ||
545 | |||
546 | case GRECS_TYPE_ARRAY: | ||
547 | comp->argv = config_array_to_argv (value, locus, &comp->argc); | ||
548 | break; | ||
549 | |||
550 | case GRECS_TYPE_LIST: | ||
551 | grecs_error (locus, 0, _("unexpected list")); | ||
552 | return 1; | ||
553 | } | ||
554 | return 0; | ||
555 | } | ||
556 | |||
557 | static int | ||
558 | _cb_umask (enum grecs_callback_command cmd, | 527 | _cb_umask (enum grecs_callback_command cmd, |
559 | grecs_locus_t *locus, | 528 | grecs_locus_t *locus, |
560 | void *varptr, grecs_value_t *value, void *cb_data) | 529 | void *varptr, grecs_value_t *value, void *cb_data) |
@@ -589,13 +558,9 @@ _cb_env (enum grecs_callback_command cmd, | |||
589 | switch (value->type) | 558 | switch (value->type) |
590 | { | 559 | { |
591 | case GRECS_TYPE_STRING: | 560 | case GRECS_TYPE_STRING: |
592 | if (wordsplit (value->v.string, &ws, WRDSF_DEFFLAGS)) | 561 | argv = grecs_calloc (2, sizeof (argv[0])); |
593 | { | 562 | argv[0] = grecs_strdup (value->v.string); |
594 | grecs_error (locus, 0, "wordsplit: %s", strerror (errno)); | 563 | argv[1] = NULL; |
595 | return 1; | ||
596 | } | ||
597 | wordsplit_get_words (&ws, &argc, &argv); | ||
598 | wordsplit_free (&ws); | ||
599 | break; | 564 | break; |
600 | 565 | ||
601 | case GRECS_TYPE_ARRAY: | 566 | case GRECS_TYPE_ARRAY: |
@@ -887,6 +852,7 @@ str_to_cf (const char *string, int *flags) | |||
887 | { "resolve", CF_RESOLVE }, | 852 | { "resolve", CF_RESOLVE }, |
888 | { "siggroup", CF_SIGGROUP }, | 853 | { "siggroup", CF_SIGGROUP }, |
889 | { "nullinput", CF_NULLINPUT }, | 854 | { "nullinput", CF_NULLINPUT }, |
855 | { "shell", CF_SHELL }, | ||
890 | { NULL } | 856 | { NULL } |
891 | }; | 857 | }; |
892 | 858 | ||
@@ -1014,9 +980,9 @@ struct grecs_keyword component_keywords[] = { | |||
1014 | NULL, | 980 | NULL, |
1015 | N_("Command line."), | 981 | N_("Command line."), |
1016 | grecs_type_string, GRECS_DFLT, | 982 | grecs_type_string, GRECS_DFLT, |
1017 | NULL, 0, | 983 | NULL, offsetof (struct component, command), |
1018 | _cb_command, | 984 | NULL, |
1019 | }, | 985 | }, |
1020 | {"prerequisites", | 986 | {"prerequisites", |
1021 | N_("list"), | 987 | N_("list"), |
1022 | N_("List of prerequisites."), | 988 | N_("List of prerequisites."), |