--- orig/bash_completion 2013-08-15 17:25:28.150693998 +0200 +++ mod/bash_completion 2013-08-15 17:27:06.654497768 +0200 @@ -1926,7 +1926,11 @@ _completion_loader() { local compfile=./completions - [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions" + if [[ $BASH_SOURCE == */* ]]; then + compfile="${BASH_SOURCE%/*}/completions" + [ -d "$HOME/.local/${compfile#/usr/*}" ] && + compfile="$HOME/.local/${compfile#/usr/*}" + fi compfile+="/${1##*/}" # Avoid trying to source dirs; https://bugzilla.redhat.com/903540 @@ -1948,7 +1952,11 @@ shift declare -F $1 &>/dev/null || { local compdir=./completions - [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions" + if [[ $BASH_SOURCE == */* ]]; then + compdir="${BASH_SOURCE%/*}/completions" + [ -d "$HOME/.local/${compdir#/usr/*}" ] && + compdir="$HOME/.local/${compdir#/usr/*}" + fi . "$compdir/$srcfile" } "$@" @@ -1971,6 +1979,7 @@ unset -f have unset have + set $BASH_COMPLETION_ORIGINAL_V_VALUE unset BASH_COMPLETION_ORIGINAL_V_VALUE