]> git.proxmox.com Git - mirror_frr.git/commitdiff
vtysh: fix autocomplete garbage printouts
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 28 Jun 2018 18:37:01 +0000 (18:37 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 28 Jun 2018 18:37:01 +0000 (18:37 +0000)
The semantics for suppressing output received from daemons changed
slightly when pipe actions were introduced, causing raw autocomplete
output to be printed where it shouldn't have been.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vtysh/vtysh.c

index 0697cd8b751811ae6568d20260d214edccb9e16c..b56eaa899f5fb7a2b55e13ff236fa34bc667f792 100644 (file)
@@ -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[] = {