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)
|
--tool)
|
||||||
# Tools seem to be named e.g. like memcheck-amd64-linux from which
|
# Tools seem to be named e.g. like memcheck-amd64-linux from which
|
||||||
# we want to grab memcheck.
|
# we want to grab memcheck.
|
||||||
COMPREPLY=( $( for f in /usr{,/local}/lib{,64}/valgrind/*; do
|
COMPREPLY=( $( compgen -W '$(
|
||||||
[[ $f != *.so && -x $f ]] &&
|
for f in /usr{,/local}/lib{,64}/valgrind/*; do
|
||||||
sed -ne "s/^.*\/\($cur.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
|
[[ $f != *.so && -x $f ]] &&
|
||||||
done) )
|
sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f
|
||||||
|
done )' -- "$cur" ) )
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--sim-hints)
|
--sim-hints)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user