argp: check if child_inputs is NULL
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
bcf1c15d8b
commit
ce2219915d
|
@ -81,7 +81,10 @@ static error_t pdwtags__options_parser(int key, char *arg __unused,
|
|||
struct argp_state *state)
|
||||
{
|
||||
switch (key) {
|
||||
case ARGP_KEY_INIT: state->child_inputs[0] = state->input; break;
|
||||
case ARGP_KEY_INIT:
|
||||
if (state->child_inputs != NULL)
|
||||
state->child_inputs[0] = state->input;
|
||||
break;
|
||||
case 'V': conf.show_decl_info = 1; break;
|
||||
default: return ARGP_ERR_UNKNOWN;
|
||||
}
|
||||
|
|
5
pfunct.c
5
pfunct.c
|
@ -453,7 +453,10 @@ static error_t pfunct__options_parser(int key, char *arg,
|
|||
struct argp_state *state)
|
||||
{
|
||||
switch (key) {
|
||||
case ARGP_KEY_INIT: state->child_inputs[0] = state->input; break;
|
||||
case ARGP_KEY_INIT:
|
||||
if (state->child_inputs != NULL)
|
||||
state->child_inputs[0] = state->input;
|
||||
break;
|
||||
case 'b': expand_types = true;
|
||||
type_emissions__init(&emissions); break;
|
||||
case 'c': class_name = arg; break;
|
||||
|
|
|
@ -291,7 +291,10 @@ static error_t pglobal__options_parser(int key, char *arg __unused,
|
|||
struct argp_state *state)
|
||||
{
|
||||
switch (key) {
|
||||
case ARGP_KEY_INIT: state->child_inputs[0] = state->input; break;
|
||||
case ARGP_KEY_INIT:
|
||||
if (state->child_inputs != NULL)
|
||||
state->child_inputs[0] = state->input;
|
||||
break;
|
||||
case 'v': walk_var = 1; break;
|
||||
case 'f': walk_fun = 1; break;
|
||||
case 'V': verbose = 1; break;
|
||||
|
|
Loading…
Reference in New Issue