From 3b4c23a0d2eb2dec15b092cc3373eedaf35a91fe Mon Sep 17 00:00:00 2001 From: ianmacd <> Date: Mon, 26 Nov 2001 18:19:59 +0000 Subject: [PATCH] make _known_hosts() escape meta-characters in paths before handing off to awk added missing ` in _service --- bash_completion | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 14da9bb6..5fee08bf 100644 --- a/bash_completion +++ b/bash_completion @@ -2,7 +2,7 @@ # # # @@ -974,6 +974,9 @@ _known_hosts() COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} cur=${cur#*@} + # Escape slashes and dots in paths for awk + cur=${cur//\//\\\/} + cur=${cur//\./\\\.} kh=() [ -r /etc/known_hosts ] && kh[0]=/etc/known_hosts @@ -1186,7 +1189,7 @@ _service() else COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ s/^.*Usage.*{\(.*\)}.*$/\1/p" \ - $sysvdir/${COMP_WORDS[1]}' $cur ) ) + $sysvdir/${COMP_WORDS[1]}`' $cur ) ) fi return 0