The following commit has been merged in the master branch:
commit 50d44ca3a4d712845d6e40c624f23ac9cd851c18
Author: Ville Skyttä <[email protected]>
Date:   Sat Jun 18 23:01:00 2011 +0300

    _services: Avoid bogus completions when init or xinetd dirs exist but are 
empty.

diff --git a/bash_completion b/bash_completion
index 4b7766f..98c2fd7 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1038,12 +1038,17 @@ _services()
     local sysvdir famdir
     [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d
     famdir=/etc/xinetd.d
+
+    local restore_nullglob=$(shopt -p nullglob); shopt -s nullglob
+
     COMPREPLY=( $( printf '%s\n' $sysvdir/!($_backup_glob|functions) ) )
 
     if [ -d $famdir ]; then
         COMPREPLY+=( $( printf '%s\n' $famdir/!($_backup_glob) ) )
     fi
 
+    $restore_nullglob
+
     COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- "$cur" 
) )
 }
 

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-commits

Reply via email to