summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/java11
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/java b/contrib/java
index cbd29f19..b9418ed8 100644
--- a/contrib/java
+++ b/contrib/java
@@ -71,12 +71,11 @@ _java_classes()
fi
elif [ -d $i ]; then
- i=${i%/}
-
- # See Debian bug #496828
- COMPREPLY=( "${COMPREPLY[@]}" $( find "$i" -type f \
- -maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | \
- command grep -v "\\$" | sed -e "s|^$i/||" ) )
+ # Intentionally looking for *.class only in $i (not subdirs),
+ # see Debian bug #496828.
+ COMPREPLY=( "${COMPREPLY[@]}"
+ $( command ls $i/$cur*.class 2>/dev/null | \
+ sed -ne '/\$/d' -e "s|^$i//*||p" ) )
# FIXME: if we have foo.class and foo/, the completion
# returns "foo/"... how to give precedence to files