[Bash-completion-commits] [SCM] bash-completion branch, frozen/1.0, updated. 6b7984078fc247b2ab25eec6642a6e1e9bd585ee
Ville Skyttä
ville.skytta at iki.fi
Sun Mar 8 21:45:30 UTC 2009
The following commit has been merged in the frozen/1.0 branch:
commit 6b7984078fc247b2ab25eec6642a6e1e9bd585ee
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Mar 8 23:43:29 2009 +0200
Simplify bash_completion.sh, return earlier in non-applicable environments.
diff --git a/CHANGES b/CHANGES
index 2d143f5..bceec9b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -135,6 +135,7 @@ bash-completion (1.0)
* Make okular complete on same files as evince, thanks to Mary Ellen Foster
(RHBZ: #486998).
* Apply ps2pdf completion to ps2pdf{12,13,14,wr} too.
+ * Simplify bash_completion.sh, return earlier in non-applicable environments.
[ Freddy Vulto ]
* Restored `_display()' completion for `display' by removing
diff --git a/bash_completion.sh b/bash_completion.sh
index e14378a..915960b 100644
--- a/bash_completion.sh
+++ b/bash_completion.sh
@@ -1,16 +1,12 @@
-# Check for bash (and that we haven't already been sourced).
-[ -z "$BASH_VERSION" -o -n "$BASH_COMPLETION" ] && return
+# Check for interactive bash and that we haven't already been sourced.
+[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
# Check for recent enough version of bash.
bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
-
-# Check for interactive shell.
-if [ -n "$PS1" ]; then
- if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then
- if [ -r /etc/bash_completion ]; then
- # Source completion code.
- . /etc/bash_completion
- fi
+if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then
+ if [ -r /etc/bash_completion ]; then
+ # Source completion code.
+ . /etc/bash_completion
fi
fi
unset bash bminor bmajor
diff --git a/debian/changelog b/debian/changelog
index 5f856ec..351c8f1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -136,6 +136,7 @@ bash-completion (1:1.0-1) UNRELEASED; urgency=low
* Make okular complete on same files as evince, thanks to Mary Ellen Foster
(RHBZ: #486998).
* Apply ps2pdf completion to ps2pdf{12,13,14,wr} too.
+ * Simplify bash_completion.sh, return earlier in non-applicable environments.
[ Freddy Vulto ]
* Restored `_display()' completion for `display' by removing
--
bash-completion
More information about the Bash-completion-commits
mailing list