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)
|
struct argp_state *state)
|
||||||
{
|
{
|
||||||
switch (key) {
|
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;
|
case 'V': conf.show_decl_info = 1; break;
|
||||||
default: return ARGP_ERR_UNKNOWN;
|
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)
|
struct argp_state *state)
|
||||||
{
|
{
|
||||||
switch (key) {
|
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;
|
case 'b': expand_types = true;
|
||||||
type_emissions__init(&emissions); break;
|
type_emissions__init(&emissions); break;
|
||||||
case 'c': class_name = arg; 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)
|
struct argp_state *state)
|
||||||
{
|
{
|
||||||
switch (key) {
|
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 'v': walk_var = 1; break;
|
||||||
case 'f': walk_fun = 1; break;
|
case 'f': walk_fun = 1; break;
|
||||||
case 'V': verbose = 1; break;
|
case 'V': verbose = 1; break;
|
||||||
|
|
3
syscse.c
3
syscse.c
|
@ -121,7 +121,8 @@ static error_t options_parser(int key, char *arg, struct argp_state *state)
|
||||||
{
|
{
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case ARGP_KEY_INIT:
|
case ARGP_KEY_INIT:
|
||||||
state->child_inputs[0] = state->input;
|
if (state->child_inputs != NULL)
|
||||||
|
state->child_inputs[0] = state->input;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
prefix = arg;
|
prefix = arg;
|
||||||
|
|
Loading…
Reference in New Issue