Fix loading completions when bash_completion was sourced without a path.

This commit is contained in:
Ville Skyttä 2011-10-13 21:08:43 +03:00
parent 86ca9ee598
commit daa4aba4c8

View File

@ -1816,7 +1816,8 @@ unset -f _install_xspec
# set up dynamic completion loading
_completion_loader()
{
local compdir="${BASH_SOURCE[0]%/*}/completions"
local compdir=./completions
[[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
# If full path below completions dir exists, use it.
if [[ $1 == */* && -f "$compdir/$1" ]]; then