The following commit has been merged in the master branch:
commit f5991cc3c1f422b6df2233cc14f83edfc9989617
Author: Ville Skyttä <[email protected]>
Date:   Wed May 13 00:01:35 2009 +0300

    Protect java class completion from unusual input, get rid of one grep.

diff --git a/bash_completion b/bash_completion
index 914fb65..2afcc9c 100644
--- a/bash_completion
+++ b/bash_completion
@@ -4735,19 +4735,19 @@ _java_classes()
        # parse each classpath element for classes
        for i in ${classpath//:/ }; do
                if [ -r $i ] && [[ "$i" == *.@(jar|zip) ]]; then
-                       if type zipinfo &> /dev/null; then
+                       if type zipinfo &>/dev/null; then
                                COMPREPLY=( "${comprep...@]}" $( zipinfo -1 \
-                               "$i" | grep "^$cur" | grep '\.class$' | \
-                               grep -v "\\$" ) )
+                                       "$i" "$cur*" 2>/dev/null | \
+                                       grep '^[^$]*\.class$' ) )
                        else
                                COMPREPLY=( "${comprep...@]}" $( jar tf "$i" \
-                               "$cur" | grep "\.class$" | grep -v "\\$" ) )
+                                       "$cur" | grep '^[^$]*\.class$' ) )
                        fi
 
                elif [ -d $i ]; then
                        i=${i%/}
                        
-                       # See bug #496828
+                       # See Debian bug #496828
                        COMPREPLY=( "${comprep...@]}" $( find "$i" -type f \
                        -maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | \
                        grep -v "\\$" | sed -e "s|^$i/||" ) )

-- 
bash-completion

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

Reply via email to