Skip to content

Commit

Permalink
__load_completion: Avoid bad array subscript on "commands" ending wit…
Browse files Browse the repository at this point in the history
…h slash

Closes #209
  • Loading branch information
scop committed May 6, 2018
1 parent 9ab622e commit 583562b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,7 @@ __load_completion()
{
local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
[[ -n $cmd ]] || return 1
for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
dirs+=( $dir/bash-completion/completions )
done
Expand Down

0 comments on commit 583562b

Please sign in to comment.