about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Zsh/Type/_command_names11
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d1b6f08d0..ef7c6c44f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-27  Clint Adams  <clint@zsh.org>
+
+	* 16500: Completion/Zsh/Type/_command_names:
+	don't complete executable files in the current directory
+	if "." is not in path.
+
 2002-01-23  Bart Schaefer  <schaefer@zsh.org>
 
 	* 16435: Src/builtin.c: Fix core dump in `hash'.
diff --git a/Completion/Zsh/Type/_command_names b/Completion/Zsh/Type/_command_names
index 006006348..71c3adfd2 100644
--- a/Completion/Zsh/Type/_command_names
+++ b/Completion/Zsh/Type/_command_names
@@ -8,9 +8,18 @@ local args defs
 
 defs=(
   'commands:external command:compadd -k commands'
-  'executables:executable file or directory:_path_files -/g \*\(-\*\)'
 )
 
+if [[ -n "$path[(r).]" ]]; then
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_path_files -/g \*\(-\*\)'
+  )
+else
+  defs=( "$defs[@]"
+         'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
+  )
+fi
+
 if [[ "$1" = -e ]]; then
   shift
 else