26 lines
1.1 KiB
Diff
26 lines
1.1 KiB
Diff
---
|
|
bash_completion.sh.in | 8 ++++----
|
|
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
--- bash_completion.sh.in
|
|
+++ bash_completion.sh.in 2014-11-17 12:17:01.505519084 +0000
|
|
@@ -1,9 +1,10 @@
|
|
# 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
|
|
+[ -z "$BASH_VERSION" ] && return
|
|
+[ -n "$BASH_COMPLETION_COMPAT_DIR" ] && return
|
|
+[[ $- =~ i ]] || return
|
|
|
|
# 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
|
|
+if [ ${BASH_VERSINFO[0]} -gt 4 ] || [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -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
|
|
@@ -11,4 +12,3 @@ if [ $bmajor -gt 4 ] || [ $bmajor -eq 4
|
|
. @pkgdatadir@/bash_completion
|
|
fi
|
|
fi
|
|
-unset bash bmajor bminor
|