Skip to content

Commit

Permalink
profile.d: Don't return from a sourced script (Debian: #741657)
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Mar 16, 2014
1 parent 293bbaa commit 867282a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions bash_completion.sh.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Check for interactive bash and that we haven't already been sourced.
[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION_COMPAT_DIR" ] && return
if [ -n "$BASH_VERSION" -a -n "$PS1" -a -z "$BASH_COMPLETION_COMPAT_DIR" ]; then

# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
# Source completion code.
. @pkgdatadir@/bash_completion
# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
if [ $bmajor -gt 4 ] || [ $bmajor -eq 4 -a $bminor -ge 1 ]; then
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
. "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then
# Source completion code.
. @pkgdatadir@/bash_completion
fi
fi
unset bash bmajor bminor

fi
unset bash bmajor bminor

0 comments on commit 867282a

Please sign in to comment.