mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 16:00:25 +00:00
lib: Fix '?'-completion dereferences in vtysh
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
f66625df51
commit
c3f24f0653
@ -823,32 +823,25 @@ vtysh_rl_describe (void)
|
|||||||
for (i = 0; i < vector_active (describe); i++)
|
for (i = 0; i < vector_active (describe); i++)
|
||||||
if ((token = vector_slot (describe, i)) != NULL)
|
if ((token = vector_slot (describe, i)) != NULL)
|
||||||
{
|
{
|
||||||
int len;
|
if (token->text[0] == '\0')
|
||||||
|
continue;
|
||||||
|
|
||||||
if (token->arg[0] == '\0')
|
int len = strlen (token->text);
|
||||||
continue;
|
|
||||||
|
|
||||||
len = strlen (token->arg);
|
if (width < len)
|
||||||
if (token->arg[0] == '.')
|
width = len;
|
||||||
len--;
|
|
||||||
|
|
||||||
if (width < len)
|
|
||||||
width = len;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < vector_active (describe); i++)
|
for (i = 0; i < vector_active (describe); i++)
|
||||||
if ((token = vector_slot (describe, i)) != NULL)
|
if ((token = vector_slot (describe, i)) != NULL)
|
||||||
{
|
{
|
||||||
if (token->arg[0] == '\0')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (! token->desc)
|
if (! token->desc)
|
||||||
fprintf (stdout," %-s\n",
|
fprintf (stdout," %-s\n",
|
||||||
token->arg[0] == '.' ? token->arg + 1 : token->arg);
|
token->text);
|
||||||
else
|
else
|
||||||
fprintf (stdout," %-*s %s\n",
|
fprintf (stdout," %-*s %s\n",
|
||||||
width,
|
width,
|
||||||
token->arg[0] == '.' ? token->arg + 1 : token->arg,
|
token->text,
|
||||||
token->desc);
|
token->desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user