Skip to content

Commit

Permalink
Fix completion loading when a symlink is sourced, thanks to Jonathan …
Browse files Browse the repository at this point in the history
…Nieder
  • Loading branch information
dpaleino committed Jan 11, 2012
1 parent 2e97527 commit 318759c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,8 @@ _minimal()
_completion_loader()
{
local compdir=./completions
[[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
local compscript=$(readlink -f $BASH_SOURCE)
[[ $compscript == */* ]] && compdir="${compscript%/*}/completions"

# Try basename.
. "$compdir/${1##*/}" &>/dev/null && return 124
Expand All @@ -1937,7 +1938,8 @@ _xfunc()
shift
declare -F $1 &>/dev/null || {
local compdir=./completions
[[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
local compscript=$(readlink -f $BASH_SOURCE)
[[ $compscript == */* ]] && compdir="${compscript%/*}/completions"
. "$compdir/$srcfile"
}
"$@"
Expand Down

0 comments on commit 318759c

Please sign in to comment.