]> git.puffer.fish Git - mirror/frr.git/commit
vtysh: don't append superflous spaces (BZ#750)
authorChristian Franke <chris@opensourcerouting.org>
Mon, 4 Mar 2013 09:23:30 +0000 (09:23 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 31 Jul 2013 15:58:05 +0000 (17:58 +0200)
commit67e7a2127c05a8c7dfddd7ffc6378edf6b666d55
treec2fa4ed97da789f0948736bd34281c0d6b252ee4
parent8ff202e2d3fa7ebbd6728fdd230f3ad1a20578cd
vtysh: don't append superflous spaces (BZ#750)

rl_completion_append_character is reset to space every time the completion
function is entered. So we would have to set it to '\0' every time
new_completion() is called. We can make this conditional and avoid using
rl_pending_input.

This code path is most relevant when there are multiple completion
matches with the same prefix, e.g. in router bgp context: "neighbor 1.2.3.4
pa"<ssive|ssword> would have been completed to "neighbor 1.2.3.4 pass "
instead of "neighbor 1.2.3.4 pass".

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
vtysh/vtysh.c