summaryrefslogtreecommitdiffstats
path: root/main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-04-24 15:58:16 +0300
committerTimo Teräs <timo.teras@iki.fi>2014-04-24 15:59:11 +0300
commitef1d7c477d98b42ecc7b83aed7d950d3088e2a02 (patch)
tree5a1c089b46b38ba03c93e4a414282c158c580384 /main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch
parent4999b4b369545730001c4bfc749d5515780416ba (diff)
downloadaports-ef1d7c477d98b42ecc7b83aed7d950d3088e2a02.tar.bz2
aports-ef1d7c477d98b42ecc7b83aed7d950d3088e2a02.tar.xz
main/quagga: cherry-pick upstream commits
fixes an annoying bug, and contains a required change for the bgpd-implement-next-hop-self-all patch to work.
Diffstat (limited to 'main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch')
-rw-r--r--main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch b/main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch
new file mode 100644
index 000000000..610e96aac
--- /dev/null
+++ b/main/quagga/0001-vtysh-don-t-append-superflous-spaces-BZ-750.patch
@@ -0,0 +1,50 @@
+From 67e7a2127c05a8c7dfddd7ffc6378edf6b666d55 Mon Sep 17 00:00:00 2001
+From: Christian Franke <chris@opensourcerouting.org>
+Date: Mon, 4 Mar 2013 09:23:30 +0000
+Subject: [PATCH] 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 | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
+index e3709e0..c575902 100644
+--- a/vtysh/vtysh.c
++++ b/vtysh/vtysh.c
+@@ -677,8 +677,9 @@ new_completion (char *text, int start, int end)
+ if (matches)
+ {
+ rl_point = rl_end;
+- if (complete_status == CMD_COMPLETE_FULL_MATCH)
+- rl_pending_input = ' ';
++ if (complete_status != CMD_COMPLETE_FULL_MATCH)
++ /* only append a space on full match */
++ rl_completion_append_character = '\0';
+ }
+
+ return matches;
+@@ -2214,9 +2215,6 @@ vtysh_readline_init (void)
+ rl_bind_key ('?', (Function *) vtysh_rl_describe);
+ rl_completion_entry_function = vtysh_completion_entry_function;
+ rl_attempted_completion_function = (CPPFunction *)new_completion;
+- /* do not append space after completion. It will be appended
+- * in new_completion() function explicitly. */
+- rl_completion_append_character = '\0';
+ }
+
+ char *
+--
+1.9.2
+