mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 14:34:22 +00:00
merge: pre-revert inapplicable changes
The following changes do not apply on master because the code has changed: - "vtysh: fix completion" reverts commit09e61a383f
. - "Revert "lib: Fix tab completions memleak, memory stats corruption"" reverts commit4dcee34bd6
. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
e2675fbd56
commit
b32cba291b
@ -2445,8 +2445,11 @@ cmd_complete_command_real (vector vline, struct vty *vty, int *status, int islib
|
|||||||
/* Only one matched */
|
/* Only one matched */
|
||||||
if (vector_slot (matchvec, 1) == NULL)
|
if (vector_slot (matchvec, 1) == NULL)
|
||||||
{
|
{
|
||||||
match_str = (char **) matchvec->index;
|
size_t index_size = matchvec->alloced * sizeof (void *);
|
||||||
vector_only_wrapper_free (matchvec);
|
match_str = XMALLOC (MTYPE_TMP, index_size);
|
||||||
|
memcpy (match_str, matchvec->index, index_size);
|
||||||
|
vector_free (matchvec);
|
||||||
|
|
||||||
*status = CMD_COMPLETE_FULL_MATCH;
|
*status = CMD_COMPLETE_FULL_MATCH;
|
||||||
return match_str;
|
return match_str;
|
||||||
}
|
}
|
||||||
@ -2488,8 +2491,11 @@ cmd_complete_command_real (vector vline, struct vty *vty, int *status, int islib
|
|||||||
/* Make new matchvec. */
|
/* Make new matchvec. */
|
||||||
matchvec = vector_init (INIT_MATCHVEC_SIZE);
|
matchvec = vector_init (INIT_MATCHVEC_SIZE);
|
||||||
vector_set (matchvec, lcdstr);
|
vector_set (matchvec, lcdstr);
|
||||||
match_str = (char **) matchvec->index;
|
|
||||||
vector_only_wrapper_free (matchvec);
|
size_t index_size = matchvec->alloced * sizeof (void *);
|
||||||
|
match_str = XMALLOC (MTYPE_TMP, index_size);
|
||||||
|
memcpy (match_str, matchvec->index, index_size);
|
||||||
|
vector_free (matchvec);
|
||||||
|
|
||||||
*status = CMD_COMPLETE_MATCH;
|
*status = CMD_COMPLETE_MATCH;
|
||||||
return match_str;
|
return match_str;
|
||||||
|
@ -832,7 +832,7 @@ command_generator (const char *text, int state)
|
|||||||
vector_set (vline, NULL);
|
vector_set (vline, NULL);
|
||||||
|
|
||||||
if (matched)
|
if (matched)
|
||||||
vector_only_index_free (matched);
|
XFREE (MTYPE_TMP, matched);
|
||||||
matched = cmd_complete_command (vline, vty, &complete_status);
|
matched = cmd_complete_command (vline, vty, &complete_status);
|
||||||
cmd_free_strvec (vline);
|
cmd_free_strvec (vline);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user