[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.90-59-g2932491

Ville Skyttä ville.skytta at iki.fi
Sun Nov 20 18:07:04 UTC 2011


The following commit has been merged in the master branch:
commit a8218ee1c9337fc8e37431d310b5a7e95d9fbfe5
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Nov 20 19:43:46 2011 +0200

    valgrind --tool: Use compgen -W instead of embedding $cur in the sed script.
    
    $cur may contain characters that break the script, for example "/".

diff --git a/completions/valgrind b/completions/valgrind
index 56add5b..1930c21 100644
--- a/completions/valgrind
+++ b/completions/valgrind
@@ -31,10 +31,11 @@ _valgrind()
         --tool)
             # Tools seem to be named e.g. like memcheck-amd64-linux from which
             # we want to grab memcheck.
-            COMPREPLY=( $( for f in /usr{,/local}/lib{,64}/valgrind/*; do
-                [[ $f != *.so && -x $f ]] &&
-                    sed -ne "s/^.*\/\($cur.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
-                done) )
+            COMPREPLY=( $( compgen -W '$(
+                for f in /usr{,/local}/lib{,64}/valgrind/*; do
+                    [[ $f != *.so && -x $f ]] &&
+                        sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
+                done )' -- "$cur" ) )
             return
             ;;
         --sim-hints)

-- 
bash-completion



More information about the Bash-completion-commits mailing list