]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: fix crash when tab-completing `do ...` commands
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sun, 18 Dec 2016 05:14:55 +0000 (05:14 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Sun, 18 Dec 2016 05:14:55 +0000 (05:14 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command.c

index a93f3a55e802bb5ce0cb1311cd1b90910ce8db6d..ca0d0c001bad6009b96f08b5b9934cb7f6082cce 100644 (file)
@@ -667,7 +667,7 @@ cmd_complete_command (vector vline, struct vty *vty, int *status)
   // construct the input line we'll be matching on
   unsigned int offset = (do_shortcut) ? 1 : 0;
   for (unsigned index = 0; index + offset < vector_active (vline); index++)
-    vector_set_index (input_line, index + offset, vector_lookup (vline, index));
+    vector_set_index (input_line, index, vector_lookup (vline, index + offset));
 
   // get token completions -- this is a copying operation
   vector comps = NULL, initial_comps;