perf completion: Update __ltrim_colon_completions
authorRamkumar Ramachandra <artagnon@gmail.com>
Thu, 4 Jul 2013 12:41:26 +0000 (18:11 +0530)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 9 Oct 2013 14:11:48 +0000 (11:11 -0300)
The function is taken from the bash-completion package; update it to use
the latest version where colon_word doesn't miss quoting.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1372941691-14684-3-git-send-email-artagnon@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/bash_completion

index 50540cfe3d18f40422f34b4d630ae1d53df8dcd4..b0cdd12bd5e48326ffdf06eb3a62c545cc32d24a 100644 (file)
@@ -11,7 +11,7 @@ __ltrim_colon_completions()
 {
        if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then
                # Remove colon-word prefix from COMPREPLY items
-               local colon_word=${1%${1##*:}}
+               local colon_word=${1%"${1##*:}"}
                local i=${#COMPREPLY[*]}
                while [[ $((--i)) -ge 0 ]]; do
                        COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"}