From 3998a70dd9a413e98876054115dd860420fefee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 27 Apr 2011 23:37:44 +0300 Subject: [PATCH] route: Don't leak local $opt. --- completions/net-tools | 2 +- test/completion/route.exp | 1 + test/lib/completions/route.exp | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/completion/route.exp create mode 100644 test/lib/completions/route.exp diff --git a/completions/net-tools b/completions/net-tools index bb9337ce..55dfa841 100644 --- a/completions/net-tools +++ b/completions/net-tools @@ -78,7 +78,7 @@ _route() fi # Remove already given options from completions - local i found + local opt found i for opt in add del -host -net netmask metric mss window irtt reject mod \ dyn reinstate dev default gw; do found=false diff --git a/test/completion/route.exp b/test/completion/route.exp new file mode 100644 index 00000000..beff8251 --- /dev/null +++ b/test/completion/route.exp @@ -0,0 +1 @@ +assert_source_completions route diff --git a/test/lib/completions/route.exp b/test/lib/completions/route.exp new file mode 100644 index 00000000..76e1b5e0 --- /dev/null +++ b/test/lib/completions/route.exp @@ -0,0 +1,20 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "route " + + +sync_after_int + + +teardown