Source stuff from completion dirs always in same order independently of locale.

This commit is contained in:
Ville Skyttä 2009-10-21 20:43:44 +03:00
parent cdc0bcc3c1
commit bc6ad9b75b
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ bash-completion (1.x)
SSH known hosts files.
* Speed up installed rpm package completion on SUSE, based on work by
Marco Poletti (Alioth: #312021).
* Improve sourcing snippets from completion dirs.
-- David Paleino <d.paleino@gmail.com> Sun, 11 Oct 2009 11:11:57 +0200

View File

@ -1642,7 +1642,8 @@ unset list
# source completion directory definitions
if [ -d $BASH_COMPLETION_COMPAT_DIR -a -r $BASH_COMPLETION_COMPAT_DIR -a \
-x $BASH_COMPLETION_COMPAT_DIR ]; then
for i in $BASH_COMPLETION_COMPAT_DIR/*; do
for i in $(LC_ALL=C command ls $BASH_COMPLETION_COMPAT_DIR); do
i=$BASH_COMPLETION_COMPAT_DIR/$i
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] &&
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
done
@ -1650,7 +1651,8 @@ fi
if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \
$BASH_COMPLETION_DIR != $BASH_COMPLETION_COMPAT_DIR -a \
-x $BASH_COMPLETION_DIR ]; then
for i in $BASH_COMPLETION_DIR/*; do
for i in $(LC_ALL=C command ls $BASH_COMPLETION_DIR); do
i=$BASH_COMPLETION_DIR/$i
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] &&
[ \( -f $i -o -h $i \) -a -r $i ] && . $i
done