mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
gpgconf: Fix --list-options for forced options
* tools/gpgconf-comp.c (retrieve_options_from_program): Ignore to to ignored options. Add failsafe code to avoid calling percent_escape with NULL. -- Remember: When using ARGPARSE_FLAG_WITHATTR the ARGPARSE_OPT_IGNORE flags in the returned type needs to be considered. GnuPG-bug-id: 5800
This commit is contained in:
parent
0b4fdbd5f4
commit
8fb23094c2
@ -2071,6 +2071,8 @@ retrieve_options_from_program (gc_component_id_t component, int only_installed)
|
|||||||
/* pargs.r_type? pargs.r.ret_str: "[cmdline]"); */
|
/* pargs.r_type? pargs.r.ret_str: "[cmdline]"); */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((pargs.r_type & ARGPARSE_OPT_IGNORE))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* We only have the short option. Search in the option table
|
/* We only have the short option. Search in the option table
|
||||||
* for the long option name. */
|
* for the long option name. */
|
||||||
@ -2111,6 +2113,9 @@ retrieve_options_from_program (gc_component_id_t component, int only_installed)
|
|||||||
opt_value = xasprintf ("%lu", pargs.r.ret_ulong);
|
opt_value = xasprintf ("%lu", pargs.r.ret_ulong);
|
||||||
break;
|
break;
|
||||||
case ARGPARSE_TYPE_STRING:
|
case ARGPARSE_TYPE_STRING:
|
||||||
|
if (!pargs.r.ret_str)
|
||||||
|
opt_value = xstrdup ("\"(none)"); /* We should not see this. */
|
||||||
|
else
|
||||||
opt_value = xasprintf ("\"%s", gc_percent_escape (pargs.r.ret_str));
|
opt_value = xasprintf ("\"%s", gc_percent_escape (pargs.r.ret_str));
|
||||||
break;
|
break;
|
||||||
default: /* ARGPARSE_TYPE_NONE or any unknown type. */
|
default: /* ARGPARSE_TYPE_NONE or any unknown type. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user