valgrind --tool: Use compgen -W instead of embedding $cur in the sed script.
$cur may contain characters that break the script, for example "/".
This commit is contained in:
parent
811666369e
commit
a8218ee1c9
@ -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
|
||||
COMPREPLY=( $( compgen -W '$(
|
||||
for f in /usr{,/local}/lib{,64}/valgrind/*; do
|
||||
[[ $f != *.so && -x $f ]] &&
|
||||
sed -ne "s/^.*\/\($cur.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
|
||||
done) )
|
||||
sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
|
||||
done )' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--sim-hints)
|
||||
|
Loading…
x
Reference in New Issue
Block a user