summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/bash-completion/files/bash-completion-1.0-shadow-compat.patch')
-rw-r--r--app-shells/bash-completion/files/bash-completion-1.0-shadow-compat.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/app-shells/bash-completion/files/bash-completion-1.0-shadow-compat.patch b/app-shells/bash-completion/files/bash-completion-1.0-shadow-compat.patch
new file mode 100644
index 000000000000..55a9781ebd30
--- /dev/null
+++ b/app-shells/bash-completion/files/bash-completion-1.0-shadow-compat.patch
@@ -0,0 +1,30 @@
+commit 86574164df810ecbd53ae841c15b38e5b06dc068
+Author: Ville Skyttä <ville.skytta@iki.fi>
+Date: Tue Apr 14 00:46:12 2009 +0300
+
+ Always use /etc/shells for chsh -s completion, don't complete on
+ comment lines in it.
+
+ Invoking chsh -l does unwanted things on some systems, such as FreeBSD.
+
+diff --git a/bash_completion b/bash_completion
+index e50da69..6f84e31 100644
+--- a/bash_completion
++++ b/bash_completion
+@@ -2569,13 +2569,10 @@ _chsh()
+ prev=${COMP_WORDS[COMP_CWORD-1]}
+
+ if [ "$prev" = "-s" ]; then
+- if [ -f /etc/debian_version ]; then
+- COMPREPLY=( $( </etc/shells ) )
+- else
+- COMPREPLY=( $( chsh -l | grep "^$cur" ) )
+- fi
++ COMPREPLY=( $( compgen -W '$( grep "^[[:space:]]*/" \
++ /etc/shells 2>/dev/null )' -- $cur ) )
+ else
+- COMPREPLY=( $( compgen -u -- $cur ) )
++ COMPREPLY=( $( compgen -u -- $cur ) )
+ fi
+
+ return 0