mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
2007-12-10 Marcus Brinkmann <marcus@g10code.de>
* gpgconf-comp.c (gc_component_list_options): Fix up expert level of group.
This commit is contained in:
parent
bc482052f8
commit
b644408d0d
@ -1,3 +1,8 @@
|
|||||||
|
2007-12-10 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
|
* gpgconf-comp.c (gc_component_list_options): Fix up expert level
|
||||||
|
of group.
|
||||||
|
|
||||||
2007-12-04 Marcus Brinkmann <marcus@g10code.de>
|
2007-12-04 Marcus Brinkmann <marcus@g10code.de>
|
||||||
|
|
||||||
* gpgconf-comp.c (gc_component_list_components): Do not print a
|
* gpgconf-comp.c (gc_component_list_components): Do not print a
|
||||||
|
@ -1531,7 +1531,6 @@ void
|
|||||||
gc_component_list_options (int component, FILE *out)
|
gc_component_list_options (int component, FILE *out)
|
||||||
{
|
{
|
||||||
const gc_option_t *option = gc_component[component].options;
|
const gc_option_t *option = gc_component[component].options;
|
||||||
const gc_option_t *group_option = NULL;
|
|
||||||
|
|
||||||
while (option && option->name)
|
while (option && option->name)
|
||||||
{
|
{
|
||||||
@ -1544,17 +1543,38 @@ gc_component_list_options (int component, FILE *out)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (option->flags & GC_OPT_FLAG_GROUP)
|
if (option->flags & GC_OPT_FLAG_GROUP)
|
||||||
group_option = option;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if (group_option)
|
const gc_option_t *group_option = option + 1;
|
||||||
|
gc_expert_level_t level = GC_LEVEL_NR;
|
||||||
|
|
||||||
|
/* The manual states that the group level is always the
|
||||||
|
minimum of the levels of all contained options. Due to
|
||||||
|
different active options, and because it is hard to
|
||||||
|
maintain manually, we calculate it here. The value in
|
||||||
|
the global static table is ignored. */
|
||||||
|
|
||||||
|
while (group_option->name)
|
||||||
{
|
{
|
||||||
list_one_option (group_option, out);
|
if (group_option->flags & GC_OPT_FLAG_GROUP)
|
||||||
group_option = NULL;
|
break;
|
||||||
|
if (group_option->level < level)
|
||||||
|
level = group_option->level;
|
||||||
|
group_option++;
|
||||||
}
|
}
|
||||||
|
|
||||||
list_one_option (option, out);
|
/* Check if group is empty. */
|
||||||
|
if (level != GC_LEVEL_NR)
|
||||||
|
{
|
||||||
|
gc_option_t opt_copy;
|
||||||
|
|
||||||
|
/* Fix up the group level. */
|
||||||
|
memcpy (&opt_copy, option, sizeof (opt));
|
||||||
|
opt_copy.level = level;
|
||||||
|
list_one_option (&opt_copy, out);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
list_one_option (option, out);
|
||||||
|
|
||||||
option++;
|
option++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user