summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-06-29 13:31:21 -0400
committerGitHub <noreply@github.com>2018-06-29 13:31:21 -0400
commitc29e9d23bf45aeeaa95b91ccdba65d4988bb81ee (patch)
treee5957ea5fa0694f4b88763ede0ad3d55b5b095ab
parent11f13d233314c44a639ec610a7c2fee39e62d4f9 (diff)
parent8d70e7fe3225c6137d6bbf9cbe6b9e53b00b935b (diff)
Merge pull request #2581 from qlyoung/fix-vtysh-autocomplete
vtysh: fix autocomplete garbage printouts
-rw-r--r--vtysh/vtysh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 0697cd8b75..b56eaa899f 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -3357,9 +3357,12 @@ static void vtysh_autocomplete(vector comps, struct cmd_token *token)
snprintf(accmd, sizeof(accmd), "autocomplete %d %s %s", token->type,
token->text, token->varname ? token->varname : "-");
+ vty->of_saved = vty->of;
+ vty->of = NULL;
for (i = 0; i < array_size(vtysh_client); i++)
vtysh_client_run_all(&vtysh_client[i], accmd, 1, vtysh_ac_line,
comps);
+ vty->of = vty->of_saved;
}
static const struct cmd_variable_handler vtysh_var_handler[] = {